8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b32c9c commit 94a877bCopy full SHA for 94a877b
test/parallel/test-source-map-api.js
@@ -1,11 +1,26 @@
1
// Flags: --enable-source-maps
2
'use strict';
3
4
-require('../common');
+const common = require('../common');
5
const assert = require('assert');
6
const { findSourceMap, SourceMap } = require('module');
7
const { readFileSync } = require('fs');
8
9
+// It should throw with invalid args.
10
+{
11
+ [1, true, 'foo'].forEach((invalidArg) =>
12
+ assert.throws(
13
+ () => new SourceMap(invalidArg),
14
+ {
15
+ code: 'ERR_INVALID_ARG_TYPE',
16
+ name: 'TypeError',
17
+ message: 'The "payload" argument must be of type object.' +
18
+ common.invalidArgTypeHelper(invalidArg)
19
+ }
20
+ )
21
+ );
22
+}
23
+
24
// findSourceMap() can lookup source-maps based on URIs, in the
25
// non-exceptional case.
26
{
0 commit comments