提交 efa40f94 编写于 作者: T Tomas Vik

docs(testing): explain jest global mock

上级 be3c5f06
...@@ -8,7 +8,7 @@ We are using [Jest](https://jestjs.io/) for our unit tests[^1]. For integration ...@@ -8,7 +8,7 @@ We are using [Jest](https://jestjs.io/) for our unit tests[^1]. For integration
## Unit tests `npm run test-unit` ## Unit tests `npm run test-unit`
Modules that **don't depend on `vscode` module** can be unit tested. Unit tests for a module are placed in the same folder. The name of the test file has `.test.js` suffix. Modules that don't depend on the `vscode` module can be unit tested. Place unit tests for a module in the same folder as the production code. The name of the test file has `.test.js` suffix. If the code under test depends on the `vscode` module, you must add the `vscode` methods and objects to the [`vscode.js`](src/__mocks__/vscode.js) [manual Jest mock](https://jestjs.io/docs/en/manual-mocks#mocking-node-modules).
- `src/git/git_remote_parser.js` - production file - `src/git/git_remote_parser.js` - production file
- `src/git/git_remote_parser.test.js` - test file - `src/git/git_remote_parser.test.js` - test file
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册