1 Star 0 Fork 35

邹伟 / theia

forked from Gitee 极速下载 / theia 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Testing.md 1.46 KB
一键复制 编辑 原始数据 按行查看 历史

Testing

Running tests

Before running make sure to compile tests with compile or watch scripts.

To run tests on theia run:

yarn test

This will run all CI enabled tests.

If you want to run all tests for a particular Theia extension, execute the following command from the root:

npx run test @theia/extension-name

Add the following npm script to the package.json of the desired Theia extension, if you would like to enable the watch mode for the tests.

  "test:watch": "theiaext test:watch"

After editing the package.json you can run the tests in watch mode with:

npx run test:watch @theia/extension-name

Test directory structure

The test directory structure is as follows:

  • src/node/foo.ts: Code to be tested.
  • src/node/foo.spec.ts: Unit tests for foo.ts.
  • src/node/test/test-helper.ts: Any mocks, fixture or utility test code goes here.
  • src/node/foo.slow-spec.ts: Any slow running tests such as integration tests should be labeled as such so that they can be excluded.
  • src/browser/foo.ui-spec.ts: UI tests.
  • test-resources: Any resources needed for the tests like configuration files or scripts.
  • test-resources/ui: Resources for UI testing.
  • test-resources/slow: Resources for slow running tests.

Publishing

Published test files

Unit tests named as foo.spec.ts will be published since they're also for documentation purposes.

Unpublished

  • *ui-spec.ts
  • *slow-spec.ts
  • test-resources
TypeScript
1
https://gitee.com/zhou-wen-jin/theia.git
git@gitee.com:zhou-wen-jin/theia.git
zhou-wen-jin
theia
theia
master

搜索帮助