summaryrefslogtreecommitdiff
path: root/test/es-module/test-esm-loader-invalid-url.mjs
blob: 4007be052dd7c7485cfb27dc2cd2258d433ab1c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Flags: --experimental-loader ./test/fixtures/es-module-loaders/loader-invalid-url.mjs
import { expectsError, mustCall } from '../common/index.mjs';
import assert from 'assert';

import('../fixtures/es-modules/test-esm-ok.mjs')
.then(assert.fail, expectsError({
  code: 'ERR_INVALID_RETURN_PROPERTY',
  message: 'Expected a valid url to be returned for the "url" from the ' +
           '"loader resolve" function but got ' +
           '../fixtures/es-modules/test-esm-ok.mjs.'
}))
.then(mustCall());