diff --git a/README.md b/README.md index f6730d39..fe580f1d 100644 --- a/README.md +++ b/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 diff --git a/README.zh-CN.md b/README.zh-CN.md index f42e6d98..0aa61bef 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -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' ``` ## 有用的信息 diff --git a/README.zh-TW.md b/README.zh-TW.md index 88046304..d46dddf0 100644 --- a/README.zh-TW.md +++ b/README.zh-TW.md @@ -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' ``` ## 有用的資訊 diff --git a/jest.config.js b/jest.config.js index 79026f34..21f6ac89 100644 --- a/jest.config.js +++ b/jest.config.js @@ -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: ['/node_modules/'], + + // If the file path matches any of the patterns, coverage information will be skipped. + coveragePathIgnorePatterns: ['/node_modules/'], + + // The pattern Jest uses to detect test files. + testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.jsx?$', };