Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .devcontainer/Dockerfile

This file was deleted.

20 changes: 0 additions & 20 deletions .devcontainer/devcontainer.json

This file was deleted.

10 changes: 0 additions & 10 deletions .devcontainer/docker-compose.yml

This file was deleted.

17 changes: 7 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,16 @@ on:
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .devcontainer

steps:
- uses: actions/checkout@v2
- name: Start containers
run: docker-compose up -d
- name: Change permissions
run: docker-compose exec -T app chown -R node:node /workspaces/jest-helpers
- name: Use Node.js 22
uses: actions/setup-node@v1
with:
node-version: 22
- name: Install dependencies
run: docker-compose exec -T --workdir /workspaces/jest-helpers --user node app npm ci
run: npm ci
- name: Build library
run: docker-compose exec -T --workdir /workspaces/jest-helpers --user node app npm run build
run: npm run build
- name: Test
run: docker-compose exec -T --workdir /workspaces/jest-helpers --user node app npm test
run: npm test
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,29 @@ It is suggested to add the following npm scripts:

```json
"scripts": {
"test": "skills17-jest run",
"test:json": "skills17-jest run --json"
"test": "jest",
"test:json": "cross-env SKILLS17_JSON=true jest"
},
```

`jest.config.ts`:

```typescript
import { JestConfigWithTsJest } from "ts-jest";

const jsonOnlyReport = !!process.env["SKILLS17_JSON"];

const config: JestConfigWithTsJest = {
clearMocks: true,
reporters: jsonOnlyReport
? [["../../../lib/skills17-reporter", { json: jsonOnlyReport }]]
: ["default", "../../../lib/skills17-reporter"],
testEnvironment: "node",
};

export default config;
```

This will provide the following commands:

- `npm test` - Run all tests once and show a nice output with the awarded points (useful for the competitors to see
Expand All @@ -45,19 +63,6 @@ folder of your task, next to the `package.json` file.
See the [`@skills17/task-config`](https://github.com/skills17/task-config#configuration) package for a detailed
description of all available properties in the `config.yaml` file.

### CLI

As seen in the installation instructions, the `skills17-jest` command is available.

It is a thin wrapper around the `jest` command.

All arguments to the command will be forwarded to `jest` so Jest can be used exactly the same way if this package
wouldn't be installed.

Additionally, the following new arguments are available:

- `--json` output the test result with scored points in json to standard out

## License

[MIT](https://github.com/skills17/jest-helpers/blob/master/LICENSE)
8 changes: 0 additions & 8 deletions bin/skills17-jest

This file was deleted.

Loading