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: make test-process-env-symbols agnostic · nodejs/node@e2f5648

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-process-env-symbols.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-process-env-symbols.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-process-env-symbols.js
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,23 @@ require('../common');
33

44
const assert = require('assert');
55
const symbol = Symbol('sym');
6-
const errRegExp = /^TypeError: Cannot convert a Symbol value to a string$/;
76

87
// Verify that getting via a symbol key returns undefined.
98
assert.strictEqual(process.env[symbol], undefined);
109

1110
// Verify that assigning via a symbol key throws.
11+
// The message depends on the JavaScript engine and so will be different between
12+
// different JavaScript engines. Confirm that the `Error` is a `TypeError` only.
1213
assert.throws(() => {
1314
process.env[symbol] = 42;
14-
}, errRegExp);
15+
}, TypeError);
1516

1617
// Verify that assigning a symbol value throws.
18+
// The message depends on the JavaScript engine and so will be different between
19+
// different JavaScript engines. Confirm that the `Error` is a `TypeError` only.
1720
assert.throws(() => {
1821
process.env.foo = symbol;
19-
}, errRegExp);
22+
}, TypeError);
2023

2124
// Verify that using a symbol with the in operator returns false.
2225
assert.strictEqual(symbol in process.env, false);

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.