测试
SheetJS 库具有广泛的测试套件。
¥SheetJS libraries have extensive test suites.
本地测试
¥Local Tests
- NodeJS
- Browser
- Bun
- Deno
- ExtendScript
make test
将运行 NodeJS 测试。默认情况下,它对每种受支持格式的文件运行测试。要测试特定文件类型,请将 FMTS
设置为所需的文件扩展名。make test_misc
提供特定于功能的测试。
¥make test
will run the NodeJS tests. By default it runs tests on files in
every supported format. To test a specific file type, set FMTS
to the desired
file extension. Feature-specific tests are available with make test_misc
.
$ make test_misc # run core tests
$ make test # run full tests
要启用所有错误,请设置环境变量 WTF=1
:
¥To enable all errors, set the environment variable WTF=1
:
$ make test # run full tests
$ WTF=1 make test # enable all error messages
flow
和 eslint
检查可用:
¥flow
and eslint
checks are available:
$ make lint # eslint checks
$ make tslint # check TS definitions
核心浏览器内测试可在本存储库中的 tests/index.html
处获得。启动本地服务器并导航到该目录以运行测试。make ctestserv
将在端口 8000 上启动服务器。
¥The core in-browser tests are available at tests/index.html
within this repo.
Start a local server and navigate to that directory to run the tests.
make ctestserv
will start a server on port 8000.
make ctest
将生成浏览器装置。要添加更多文件,请编辑 tests/fixtures.lst
文件并添加路径。
¥make ctest
will generate the browser fixtures. To add more files, edit the
tests/fixtures.lst
file and add the paths.
make test-bun
将运行完整的 Bun 测试套件,make test-bun_misc
将运行较小的特定功能测试。
¥make test-bun
will run the full Bun test suite and make test-bun_misc
will run the smaller feature-specific tests.
make test-deno
将运行完整的 Deno 测试套件,make test-deno_misc
将运行较小的特定功能测试。
¥make test-deno
will run the full Deno test suite and make test-deno_misc
will run the smaller feature-specific tests.
make dist
将构建 xlsx.extendscript.js
。
¥make dist
will build xlsx.extendscript.js
.
项目根目录下的脚本 estk.jsx
配置为在 ExtendScript Toolkit 中运行。它将读取 sheetjs.xlsx
并尝试以多种文件格式写入测试文件。
¥The script estk.jsx
at the root of the project is configured to run in
ExtendScript Toolkit. It will read sheetjs.xlsx
and attempt to write test
files in a number of file formats.
ExtendScript Toolkit 3.5 可作为 Windows 的独立下载。
¥ExtendScript Toolkit 3.5 is available as a standalone download for Windows.
测试环境
¥Tested Environments
(click to show)
Browsers
- IE 6/7/8/9/10/11 (IE 6-9 require shims)
- Chrome 26+ (including Android 6.0+)
- Safari 8+ (Desktop) and Safari 10+ (iOS)
- Edge 13-18 and 79+
- FF Latest
The automated browser tests seek to test the latest patch version of each major
release of Chromium ending in 0
(starting from Chrome 30).
Edge originally was an independent browser, becoming a Chromium fork in version
79. Since the new releases should be nearly identical to the Chrome counterpart,
the Edge tests are run on major releases ending in 5
(starting from Edge 85).
Server Platforms
- NodeJS
0.8
,0.10
,0.12
, and every major version starting from4
- io.js 1/2/3
- Bun latest
- Deno latest
The test suite also includes tests for various time zones. Timezones can be
controlled by setting the TZ
environment variable:
env TZ="Asia/Kolkata" WTF=1 make test_misc
测试文件
¥Test Files
工件来源
¥Artifact Sources
测试文件包括来自外部源的文件的衍生文件。文件在各种电子表格软件中打开并导出为 CSV 和其他文件格式。随附的 README.md
文件解释了命名约定和文件来源。
¥Test files include derivatives of files from external sources. Files were opened
in various spreadsheet software and exported to CSV and other file formats. The
enclosed README.md
file explains the naming conventions and file origins.
外部来源通常根据开源许可分发文件。一些来源有专用于公共字段的文件。
¥External sources typically distribute files under open source licenses. Some sources have dedicated files to the public domain.
假设外部来源具有根据声明的许可条款发布文件的适当授权。例如,如果外部源根据 Apache 2.0 许可证发布文件,则假定他们直接生成文件或获得创建者的许可。
¥It is assumed that external sources have proper authorization to release files under the asserted license terms. For example, if an external source releases a file under the Apache 2.0 license, it is assumed that they either generated the file directly or obtained permission from the creator.
删除请求
¥Requests for Removal
外部来源可能在未经适当同意的情况下添加了来自贡献者的文件。如果文件包含未经发布原始内容的各方适当审查的私有信息,我们鼓励用户提交报告。
¥External sources may have added files from contributors without proper consent. Users are encouraged to submit reports if files contain private information that was not properly vetted by the parties that posted the original content.
请输入 发送电子邮件 或 在主源存储库中提交问题。
¥Please send an email or file an issue in the main source repository.