node/test/parallel/test-process-setsourcemapsenabled.js
legendecas 82b1b55122 process: add api to enable source-maps programmatically
Add `process.setSourceMapsEnabled` to enable
source-maps programmatically.

PR-URL: https://github.com/nodejs/node/pull/39085
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-07-15 19:45:16 +08:00

17 lines
276 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
const unexpectedValues = [
undefined,
null,
1,
{},
() => {},
];
for (const it of unexpectedValues) {
assert.throws(() => {
process.setSourceMapsEnabled(it);
}, /ERR_INVALID_ARG_TYPE/);
}