Skip to content

Commit

Permalink
test: improve test coverage SourceMap API
Browse files Browse the repository at this point in the history
PR-URL: #36089
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
juanarbol authored and danielleadams committed Dec 7, 2020
1 parent 44d6d0b commit 69a8f05
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/parallel/test-source-map-api.js
Original file line number Diff line number Diff line change
@@ -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.
{
Expand Down

0 comments on commit 69a8f05

Please sign in to comment.