Skip to content

Commit 0a28ef2

Browse files
test_runner: make skip/todo/expectFailure use JS truthiness (#61815)
1 parent 53bcd11 commit 0a28ef2

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

lib/internal/test_runner/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ class Test extends AsyncResource {
679679
this.expectedAssertions = plan;
680680
this.cancelled = false;
681681
this.expectFailure = parseExpectFailure(expectFailure) || this.parent?.expectFailure;
682-
this.skipped = skip !== undefined && skip !== false;
682+
this.skipped = Boolean(skip);
683683
this.isTodo = (todo !== undefined && todo !== false) || this.parent?.isTodo;
684684
this.startTime = null;
685685
this.endTime = null;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
const { test } = require('node:test');
3+
const assert = require('assert');
4+
5+
let ran = false;
6+
7+
test('skip option empty string should not skip', { skip: '' }, () => {
8+
ran = true;
9+
});
10+
11+
process.on('exit', () => {
12+
assert.ok(ran);
13+
});

0 commit comments

Comments
 (0)