Skip to content

Commit

Permalink
chore: improve test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
wellwelwel committed May 19, 2024
1 parent bb03229 commit d441a30
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
37 changes: 34 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,43 @@ We can discuss design of API and implementation ideas.

### General (recommended)

#### Sequential and Parallel

```sh
npm run test # Test with the locally installed Node.js version
npm run test:bun # Test with the locally installed Bun version
```

#### Sequential

```sh
npm run test # Test with the installed Node.js version
npm run test:options # Test with the installed Node.js version using CLI options
npm run test:bun # Test with the installed Bun version
npm run test:sequential # Test with the locally installed Node.js version
npm run test:bun:sequential # Test with the locally installed Bun version
```

> Pass custom flags using `--`, for example:
>
> ```sh
> npm run test:sequential -- --debug --fail-fast
> ```
>
> - Same for **Bun**
#### Parallel
```sh
npm run test:parallel # Test with the locally installed Node.js version
npm run test:bun:parallel # Test with the locally installed Bun version
```
> Pass custom flags using `--`, for example:
>
> ```sh
> npm run test:parallel -- --concurrency=5 --fail-fast
> ```
>
> - Same for **Bun**
### Coverage
Methods that vary according to **Node.js** version, platform or OS aren't tested against the coverage rate.
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
"description": "🐷 Poku makes testing easy for Node.js, Bun & Deno at the same time.",
"main": "./lib/index.js",
"scripts": {
"test": "tsx src/bin/index.ts --parallel --include=\"test/unit,test/integration,test/e2e\"",
"test:options": " tsx src/bin/index.ts --parallel --concurrency=\"4\" --fast-fail --debug --exclude=\".bak\" --kill-port=\"4000\" --kill-range=\"4000-4001\" --include=\"test/unit,test/integration,test/e2e\"",
"test:bun": "bun src/bin/index.ts --platform=bun --include=\"test/unit,test/integration,test/e2e\"",
"test": "npm run test:parallel && npm run test:sequential",
"test:bun": "npm run test:bun:parallel && npm run test:bun:sequential",
"test:sequential": "tsx src/bin/index.ts --include=\"test/unit,test/integration,test/e2e\"",
"test:parallel": "npm run test:sequential -- --parallel",
"test:bun:sequential": "bun src/bin/index.ts --platform=\"bun\" --include=\"test/unit,test/integration,test/e2e\"",
"test:bun:parallel": "npm run test:bun:sequential -- --parallel",
"test:c8:sequential": "c8 tsx src/bin/index.ts --include=\"test/unit,test/integration,test/e2e\"",
"test:c8:parallel": "c8 tsx src/bin/index.ts --parallel --include=\"test/unit,test/integration,test/e2e\"",
"test:c8:sequential:options": "c8 tsx src/bin/index.ts --fast-fail --debug --exclude=\".bak\" --kill-port=\"4000\" --kill-range=\"4000-4001\" --include=\"test/unit,test/integration,test/e2e\"",
Expand Down
3 changes: 2 additions & 1 deletion src/modules/create-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const backgroundProcess = (
shell: isWindows,
cwd: options?.cwd
? sanitizePath(path.normalize(options.cwd))
: undefined,
: /* c8 ignore next */
undefined,
env: process.env,
/* c8 ignore next */
detached: !isWindows,
Expand Down

0 comments on commit d441a30

Please sign in to comment.