Skip to content

Commit 69a8f05

Browse files
juanarboldanielleadams
authored andcommitted
test: improve test coverage SourceMap API
PR-URL: #36089 Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 44d6d0b commit 69a8f05

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Diff for: test/parallel/test-source-map-api.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
// Flags: --enable-source-maps
22
'use strict';
33

4-
require('../common');
4+
const common = require('../common');
55
const assert = require('assert');
66
const { findSourceMap, SourceMap } = require('module');
77
const { readFileSync } = require('fs');
88

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+
924
// findSourceMap() can lookup source-maps based on URIs, in the
1025
// non-exceptional case.
1126
{

0 commit comments

Comments
 (0)