Testing测试
- NodeJS
- Browser
- Deno
- Extendscript
make test
will run the node-based tests. 将运行基于节点的测试。By default it runs tests on files in every supported format. 默认情况下,它以每种支持的格式对文件运行测试。To test a specific file type, set 要测试特定的文件类型,请将FMTS
to the format you want to test. FMTS
设置为要测试的格式。Feature-specific tests are available with make test_misc
make test_misc
提供了特定于功能的测试
$ make test_misc # run core tests
$ make test # run full tests
To enable all errors, set the environment variable 要启用所有错误,请将环境变量WTF=1
:WTF
设置为1:
$ make test # run full tests
$ WTF=1 make test # enable all error messages
flow
and eslint
checks are available:flow
和eslint
检查可用:
$ make lint # eslint checks
$ make tslint # check TS definitions
The core in-browser tests are available at 浏览器中的核心测试可在本回购协议的tests/index.html
within this repo. tests/index.html
中获得。Start a local server and navigate to that directory to run the tests. 启动本地服务器并导航到该目录以运行测试。make ctestserv
will start a server on port 8000.make ctestserv
将在端口8000上启动服务器。
make ctest
will generate the browser fixtures. 将生成浏览器装置。To add more files, edit the 要添加更多文件,请编辑tests/fixtures.lst
file and add the paths.tests/fixtures.lst
文件并添加路径。
make test-deno
will run the full Deno test suite and 将运行完整的Deno测试套件,并make test-deno_misc
will run the smaller feature-specific tests.make test-deno_misc
将运行较小的功能特定测试。
make dist
will build 将生成xlsx.extendscript.js
.xlsx.extendscript.js
。
The script 项目根目录下的脚本estk.jsx
at the root of the project is configured to run in ExtendScript Toolkit. estk.jsx
配置为在ExtendScript工具包中运行。It will read 它将读取sheetjs.xlsx
and attempt to write test files in a number of file formats.sheetjs.xlsx
并尝试以多种文件格式编写测试文件。
ExtendScript Toolkit 3.5 is available as a standalone download for Windows.ExtendScript Toolkit 3.5可作为Windows的独立下载。
Tested Environments测试环境
(click to show)
- NodeJS
0.8
,0.10
,0.12
,4.x
,5.x
,6.x
,7.x
,8.x
- IE 6/7/8/9/10/11 (IE 6-9 require shims)
- Chrome 24+ (including Android 4.0+)
- Safari 6+ (iOS and Desktop)
- Edge 13+, FF 18+, and Opera 12+
Tests utilize the mocha testing framework.测试使用mocha测试框架。
- https://saucelabs.com/u/sheetjs
for XLS* modules using Sauce Labs用于使用Sauce Labs的XLS*模块
The test suite also includes tests for various time zones. 测试套件还包括各种时区的测试。 To change the timezone locally, set the TZ environment variable:要在本地更改时区,请设置TZ环境变量:
$ env TZ="Asia/Kolkata" WTF=1 make test_misc
Test Files测试文件
Test files are housed in another repo.测试文件存放在另一个repo中。
Running 运行make init
will refresh the test_files
submodule and get the files. make init
将刷新test_files
子模块并获取文件。Note that this requires 注意,这需要svn
, git
, hg
and other commands that may not be available. svn
、git
、hg
和其他可能不可用的命令。If 如果make init
fails, please download the latest version of the test files snapshot from the repomake init
失败,请从repo下载最新版本的测试文件快照
Latest Snapshot最新快照
http://github.com/SheetJS/test_files/releases/download/20170409/test_files.zip
(download and unzip to the (下载并解压缩到test_files
subdirectory)test_files
子目录)