From 19959473818cc64ead74ee7bbd7c2c524d40c216 Mon Sep 17 00:00:00 2001 From: Vaishnavi J K Date: Wed, 18 Mar 2026 21:42:09 +0530 Subject: [PATCH 1/4] test_runner: make skip/todo/expectFailure use JS truthiness (#61815) --- lib/internal/test_runner/test.js | 2 +- test/parallel/test-runner-skip-empty-string.js | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 test/parallel/test-runner-skip-empty-string.js diff --git a/lib/internal/test_runner/test.js b/lib/internal/test_runner/test.js index 2203bbd3497659..7e8d1a3f539f75 100644 --- a/lib/internal/test_runner/test.js +++ b/lib/internal/test_runner/test.js @@ -679,7 +679,7 @@ class Test extends AsyncResource { this.expectedAssertions = plan; this.cancelled = false; this.expectFailure = parseExpectFailure(expectFailure) || this.parent?.expectFailure; - this.skipped = skip !== undefined && skip !== false; + this.skipped = Boolean(skip); this.isTodo = (todo !== undefined && todo !== false) || this.parent?.isTodo; this.startTime = null; this.endTime = null; diff --git a/test/parallel/test-runner-skip-empty-string.js b/test/parallel/test-runner-skip-empty-string.js new file mode 100644 index 00000000000000..c348f44d7c9206 --- /dev/null +++ b/test/parallel/test-runner-skip-empty-string.js @@ -0,0 +1,13 @@ +'use strict'; +const { test } = require('node:test'); +const assert = require('assert'); + +let ran = false; + +test('skip option empty string should not skip', { skip: '' }, () => { + ran = true; +}); + +process.on('exit', () => { + assert.ok(ran); +}); \ No newline at end of file From c08538a38842ec329969eb607efce7071952bce8 Mon Sep 17 00:00:00 2001 From: Vaishnavi J K Date: Fri, 20 Mar 2026 12:46:49 +0530 Subject: [PATCH 2/4] test_runner:make skip/todo/expectFailure use JS truthiness (#61815) --- lib/internal/test_runner/test.js | 1 + test/parallel/test-runner-skip-empty-string.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/internal/test_runner/test.js b/lib/internal/test_runner/test.js index 7e8d1a3f539f75..33f1b77a29932d 100644 --- a/lib/internal/test_runner/test.js +++ b/lib/internal/test_runner/test.js @@ -9,6 +9,7 @@ const { ArrayPrototypeSplice, ArrayPrototypeUnshift, ArrayPrototypeUnshiftApply, + Boolean, Error, FunctionPrototype, MathMax, diff --git a/test/parallel/test-runner-skip-empty-string.js b/test/parallel/test-runner-skip-empty-string.js index c348f44d7c9206..799f8d1585859c 100644 --- a/test/parallel/test-runner-skip-empty-string.js +++ b/test/parallel/test-runner-skip-empty-string.js @@ -1,4 +1,6 @@ 'use strict'; +require('../common'); + const { test } = require('node:test'); const assert = require('assert'); @@ -10,4 +12,4 @@ test('skip option empty string should not skip', { skip: '' }, () => { process.on('exit', () => { assert.ok(ran); -}); \ No newline at end of file +}); From 0663f84315557796d2fe7aa3a650196dc9605fea Mon Sep 17 00:00:00 2001 From: Vaishnavi J K Date: Fri, 20 Mar 2026 17:34:05 +0530 Subject: [PATCH 3/4] test: use common.mustCall() for skip empty string test --- test/parallel/test-runner-skip-empty-string.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/test/parallel/test-runner-skip-empty-string.js b/test/parallel/test-runner-skip-empty-string.js index 799f8d1585859c..aefdf24600fe50 100644 --- a/test/parallel/test-runner-skip-empty-string.js +++ b/test/parallel/test-runner-skip-empty-string.js @@ -1,15 +1,6 @@ 'use strict'; -require('../common'); +const common = require('../common'); const { test } = require('node:test'); -const assert = require('assert'); -let ran = false; - -test('skip option empty string should not skip', { skip: '' }, () => { - ran = true; -}); - -process.on('exit', () => { - assert.ok(ran); -}); +test('skip option empty string should not skip', { skip: '' }, common.mustCall()); \ No newline at end of file From d10c419f03e5952dac9958161ecc5783ad132252 Mon Sep 17 00:00:00 2001 From: Vaishnavi J K Date: Sun, 22 Mar 2026 01:11:11 +0530 Subject: [PATCH 4/4] test: add newline at end of file --- test/parallel/test-runner-skip-empty-string.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-runner-skip-empty-string.js b/test/parallel/test-runner-skip-empty-string.js index aefdf24600fe50..03352ce9a475e8 100644 --- a/test/parallel/test-runner-skip-empty-string.js +++ b/test/parallel/test-runner-skip-empty-string.js @@ -3,4 +3,4 @@ const common = require('../common'); const { test } = require('node:test'); -test('skip option empty string should not skip', { skip: '' }, common.mustCall()); \ No newline at end of file +test('skip option empty string should not skip', { skip: '' }, common.mustCall());