GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_runner: fix env option validation · nodejs/node@32ead10

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/test_runner
    • runner.js
  • test/parallel
    • test-runner-run.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/test_runner/runner.js‎

Copy file name to clipboardExpand all lines: lib/internal/test_runner/runner.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ function run(options = kEmptyObject) {
908908
}
909909

910910
if (env != null) {
911-
validateObject(env);
911+
validateObject(env, 'options.env');
912912

913913
if (isolation === 'none') {
914914
throw new ERR_INVALID_ARG_VALUE('options.env', env, 'is not supported with isolation=\'none\'');
Collapse file

‎test/parallel/test-runner-run.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-runner-run.mjs
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,14 @@ describe('require(\'node:test\').run', { concurrency: true }, () => {
675675
}));
676676
});
677677

678+
it('should only allow object in options.env', () => {
679+
[Symbol(), [], () => {}, 0, 1, 0n, 1n, '', '1', true, false]
680+
.forEach((env) => assert.throws(() => run({ files: [], env }), {
681+
code: 'ERR_INVALID_ARG_TYPE',
682+
message: /The "options\.env" property must be of type object\./
683+
}));
684+
});
685+
678686
it('should not allow files and globPatterns used together', () => {
679687
assert.throws(() => run({ files: ['a.js'], globPatterns: ['*.js'] }), {
680688
code: 'ERR_INVALID_ARG_VALUE'

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.