@@ -26,11 +26,29 @@ It is suggested to add the following npm scripts:
2626
2727``` json
2828"scripts" : {
29- "test" : " skills17- jest run " ,
30- "test:json" : " skills17-jest run --json "
29+ "test" : " jest" ,
30+ "test:json" : " cross-env SKILLS17_JSON=true jest "
3131},
3232```
3333
34+ ` jest.config.ts ` :
35+
36+ ``` typescript
37+ import { JestConfigWithTsJest } from " ts-jest" ;
38+
39+ const jsonOnlyReport = !! process .env [" SKILLS17_JSON" ];
40+
41+ const config: JestConfigWithTsJest = {
42+ clearMocks: true ,
43+ reporters: jsonOnlyReport
44+ ? [[" ../../../lib/skills17-reporter" , { json: jsonOnlyReport }]]
45+ : [" default" , " ../../../lib/skills17-reporter" ],
46+ testEnvironment: " node" ,
47+ };
48+
49+ export default config ;
50+ ```
51+
3452This will provide the following commands:
3553
3654- ` npm test ` - Run all tests once and show a nice output with the awarded points (useful for the competitors to see
@@ -45,19 +63,6 @@ folder of your task, next to the `package.json` file.
4563See the [ ` @skills17/task-config ` ] ( https://github.com/skills17/task-config#configuration ) package for a detailed
4664description of all available properties in the ` config.yaml ` file.
4765
48- ### CLI
49-
50- As seen in the installation instructions, the ` skills17-jest ` command is available.
51-
52- It is a thin wrapper around the ` jest ` command.
53-
54- All arguments to the command will be forwarded to ` jest ` so Jest can be used exactly the same way if this package
55- wouldn't be installed.
56-
57- Additionally, the following new arguments are available:
58-
59- - ` --json ` output the test result with scored points in json to standard out
60-
6166## License
6267
6368[ MIT] ( https://github.com/skills17/jest-helpers/blob/master/LICENSE )
0 commit comments