blob: d780f1a22164d72e107203e720a167cf13423c8c [file] [log] [blame] [edit]
'use strict';
const common = 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;
}
);
})().then(common.mustCall());