0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/es-module/test-esm-loader-invalid-format.mjs
Anna Henningsen deff8dbf49
test: fix ESM test
The previously landed commit was broken and it’s too late
to force-push. Fixing up the test seems to work.

Refs: https://github.com/nodejs/node/pull/21352

PR-URL: https://github.com/nodejs/node/pull/21605
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-06-30 14:13:32 +02:00

12 lines
471 B
JavaScript

// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/loader-invalid-format.mjs
import { expectsError, mustCall } from '../common';
import assert from 'assert';
import('../fixtures/es-modules/test-esm-ok.mjs')
.then(assert.fail, expectsError({
code: 'ERR_INVALID_RETURN_PROPERTY_VALUE',
message: 'Expected string to be returned for the "format" from the ' +
'"loader resolve" function but got type undefined.'
}))
.then(mustCall());