Skip to content

Commit 477bf10

Browse files
first version
1 parent ce372a8 commit 477bf10

25 files changed

Lines changed: 1930 additions & 1119 deletions

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
3452
This 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.
4563
See the [`@skills17/task-config`](https://github.com/skills17/task-config#configuration) package for a detailed
4664
description 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)

bin/skills17-jest

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)