We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 44d6d0b commit 69a8f05Copy full SHA for 69a8f05
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