mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
test: improve test coverage SourceMap API
PR-URL: https://github.com/nodejs/node/pull/36089 Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
9b32c9c575
commit
94a877b0a4
1 file changed
+16
-1
@@ -1,11 +1,26 @@
|
||||
// Flags: --enable-source-maps
|
||||
'use strict';
|
||||
|
||||
require('../common');
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const { findSourceMap, SourceMap } = require('module');
|
||||
const { readFileSync } = require('fs');
|
||||
|
||||
// It should throw with invalid args.
|
||||
{
|
||||
[1, true, 'foo'].forEach((invalidArg) =>
|
||||
assert.throws(
|
||||
() => new SourceMap(invalidArg),
|
||||
{
|
||||
code: 'ERR_INVALID_ARG_TYPE',
|
||||
name: 'TypeError',
|
||||
message: 'The "payload" argument must be of type object.' +
|
||||
common.invalidArgTypeHelper(invalidArg)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// findSourceMap() can lookup source-maps based on URIs, in the
|
||||
// non-exceptional case.
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user