Skip to main content

Testing测试

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_miscmake 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:floweslint检查可用:

$ make lint        # eslint checks
$ make tslint # check TS definitions

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测试框架。

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. 注意,这需要svngithg和其他可能不可用的命令。If make init fails, please download the latest version of the test files snapshot from the repo如果make 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子目录)