mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-26 07:01:18 +08:00
Update Jest configuration file.
This commit is contained in:
parent
bb86b30dda
commit
92a90606dc
12
README.md
12
README.md
@ -174,6 +174,14 @@ tree is being used.
|
||||
npm install
|
||||
```
|
||||
|
||||
**Run ESLint**
|
||||
|
||||
You may want to run it to check code quality.
|
||||
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
**Run all tests**
|
||||
```
|
||||
npm test
|
||||
@ -181,7 +189,7 @@ npm test
|
||||
|
||||
**Run tests by name**
|
||||
```
|
||||
npm test -- -t 'LinkedList'
|
||||
npm test -- 'LinkedList'
|
||||
```
|
||||
|
||||
**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:
|
||||
|
||||
```
|
||||
npm test -- -t 'playground'
|
||||
npm test -- 'playground'
|
||||
```
|
||||
|
||||
## Useful Information
|
||||
|
@ -147,7 +147,7 @@ npm test
|
||||
|
||||
**按照名称执行测试**
|
||||
```
|
||||
npm test -- -t 'LinkedList'
|
||||
npm test -- 'LinkedList'
|
||||
```
|
||||
|
||||
**Playground**
|
||||
@ -157,7 +157,7 @@ npm test -- -t 'LinkedList'
|
||||
然后,只需运行以下命令来测试你的 Playground 是否按无误:
|
||||
|
||||
```
|
||||
npm test -- -t 'playground'
|
||||
npm test -- 'playground'
|
||||
```
|
||||
|
||||
## 有用的信息
|
||||
|
@ -145,7 +145,7 @@ npm test
|
||||
|
||||
**以名稱執行該測試**
|
||||
```
|
||||
npm test -- -t 'LinkedList'
|
||||
npm test -- 'LinkedList'
|
||||
```
|
||||
**練習場**
|
||||
|
||||
@ -154,7 +154,7 @@ npm test -- -t 'LinkedList'
|
||||
接著直接執行下列的指令來測試你練習的 code 是否如預期運作:
|
||||
|
||||
```
|
||||
npm test -- -t 'playground'
|
||||
npm test -- 'playground'
|
||||
```
|
||||
|
||||
## 有用的資訊
|
||||
|
@ -1,5 +1,23 @@
|
||||
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,
|
||||
|
||||
// Indicates whether the coverage information should be collected while executing the test
|
||||
collectCoverage: false,
|
||||
|
||||
// The directory where Jest should output its coverage files.
|
||||
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?$',
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user