Skip to content

Commit 97d048c

Browse files
first version (#1)
1 parent ce372a8 commit 97d048c

29 files changed

+1937
-1162
lines changed

.devcontainer/Dockerfile

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

.devcontainer/devcontainer.json

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

.devcontainer/docker-compose.yml

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

.github/workflows/test.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,16 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12-
defaults:
13-
run:
14-
working-directory: .devcontainer
1512

1613
steps:
1714
- uses: actions/checkout@v2
18-
- name: Start containers
19-
run: docker-compose up -d
20-
- name: Change permissions
21-
run: docker-compose exec -T app chown -R node:node /workspaces/jest-helpers
15+
- name: Use Node.js 22
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 22
2219
- name: Install dependencies
23-
run: docker-compose exec -T --workdir /workspaces/jest-helpers --user node app npm ci
20+
run: npm ci
2421
- name: Build library
25-
run: docker-compose exec -T --workdir /workspaces/jest-helpers --user node app npm run build
22+
run: npm run build
2623
- name: Test
27-
run: docker-compose exec -T --workdir /workspaces/jest-helpers --user node app npm test
24+
run: npm test

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)