blob: b13e793626876a377702adb04c1739d3f64b22bb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
'use strict';
require('../common');
const assert = require('assert');
const file = '../fixtures/syntax/bad_syntax.mjs';
let error;
(async () => {
try {
await import(file);
} catch (e) {
assert.strictEqual(e.name, 'SyntaxError');
error = e;
}
assert(error);
await assert.rejects(
() => import(file),
(e) => {
assert.strictEqual(error, e);
return true;
}
);
})();
|