Skip to content
Merged
Changes from 1 commit
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
Next Next commit
doc: set exit code in custom test runner example
Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Dec 5, 2023
commit 5d33812160204dc0c8b2114320ac212fd41e2309
6 changes: 6 additions & 0 deletions doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,9 @@ import process from 'node:process';
import path from 'node:path';

run({ files: [path.resolve('./tests/test.js')] })
.on('test:fail', () => {
process.exitCode = 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
process.exitCode = 1
process.exitCode = 1;

})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
process.exitCode = 1
})
process.exitCode = 1;
})

.compose(tap)
.pipe(process.stdout);
```
Expand All @@ -1164,6 +1167,9 @@ const { run } = require('node:test');
const path = require('node:path');

run({ files: [path.resolve('./tests/test.js')] })
.on('test:fail', () => {
process.exitCode = 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
process.exitCode = 1
process.exitCode = 1;

})
.compose(tap)
.pipe(process.stdout);
```
Expand Down