node/test/parallel/test-process-env-sideeffects.js
Antoine du Hamel 634dc26605
test: ensure assertions are reached on all tests
PR-URL: https://github.com/nodejs/node/pull/60845
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-11-27 09:35:25 +00:00

24 lines
579 B
JavaScript

'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
// Test that read-only process.env access is considered to have no
// side-effects by the inspector.
const assert = require('assert');
const inspector = require('inspector');
const session = new inspector.Session();
session.connect();
process.env.TESTVAR = 'foobar';
session.post('Runtime.evaluate', {
expression: 'process.env.TESTVAR',
throwOnSideEffect: true
}, common.mustSucceed((res) => {
assert.deepStrictEqual(res, {
result: { type: 'string', value: 'foobar' }
});
}));