Update Jest configuration file.

This commit is contained in:
Oleksii Trekhleb 2018-07-07 10:14:00 +03:00
parent bb86b30dda
commit 92a90606dc
4 changed files with 32 additions and 6 deletions

View File

@ -174,6 +174,14 @@ tree is being used.
npm install npm install
``` ```
**Run ESLint**
You may want to run it to check code quality.
```
npm run lint
```
**Run all tests** **Run all tests**
``` ```
npm test npm test
@ -181,7 +189,7 @@ npm test
**Run tests by name** **Run tests by name**
``` ```
npm test -- -t 'LinkedList' npm test -- 'LinkedList'
``` ```
**Playground** **Playground**
@ -192,7 +200,7 @@ tests for it in `./src/playground/__test__/playground.test.js`.
Then just simply run the following command to test if your playground code works as expected: Then just simply run the following command to test if your playground code works as expected:
``` ```
npm test -- -t 'playground' npm test -- 'playground'
``` ```
## Useful Information ## Useful Information

View File

@ -147,7 +147,7 @@ npm test
**按照名称执行测试** **按照名称执行测试**
``` ```
npm test -- -t 'LinkedList' npm test -- 'LinkedList'
``` ```
**Playground** **Playground**
@ -157,7 +157,7 @@ npm test -- -t 'LinkedList'
然后,只需运行以下命令来测试你的 Playground 是否按无误: 然后,只需运行以下命令来测试你的 Playground 是否按无误:
``` ```
npm test -- -t 'playground' npm test -- 'playground'
``` ```
## 有用的信息 ## 有用的信息

View File

@ -145,7 +145,7 @@ npm test
**以名稱執行該測試** **以名稱執行該測試**
``` ```
npm test -- -t 'LinkedList' npm test -- 'LinkedList'
``` ```
**練習場** **練習場**
@ -154,7 +154,7 @@ npm test -- -t 'LinkedList'
接著直接執行下列的指令來測試你練習的 code 是否如預期運作: 接著直接執行下列的指令來測試你練習的 code 是否如預期運作:
``` ```
npm test -- -t 'playground' npm test -- 'playground'
``` ```
## 有用的資訊 ## 有用的資訊

View File

@ -1,5 +1,23 @@
module.exports = { module.exports = {
// The bail config option can be used here to have Jest stop running tests after
// the first failure.
bail: false,
// Indicates whether each individual test should be reported during the run.
verbose: false, verbose: false,
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: false, collectCoverage: false,
// The directory where Jest should output its coverage files.
coverageDirectory: './coverage/', coverageDirectory: './coverage/',
// If the test path matches any of the patterns, it will be skipped.
testPathIgnorePatterns: ['<rootDir>/node_modules/'],
// If the file path matches any of the patterns, coverage information will be skipped.
coveragePathIgnorePatterns: ['<rootDir>/node_modules/'],
// The pattern Jest uses to detect test files.
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.jsx?$',
}; };