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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
juanarbol authored and targos committed May 1, 2021
1 parent 9b32c9c commit 94a877b
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 94a877b

Please sign in to comment.