diff options
Diffstat (limited to 'test/fixtures')
-rw-r--r-- | test/fixtures/node_modules/pkgexports/package.json | 1 | ||||
-rw-r--r-- | test/fixtures/pkgexports-missing.mjs | 11 | ||||
-rw-r--r-- | test/fixtures/pkgexports.mjs | 15 |
3 files changed, 12 insertions, 15 deletions
diff --git a/test/fixtures/node_modules/pkgexports/package.json b/test/fixtures/node_modules/pkgexports/package.json index b0c8867bb4..97f07da85e 100644 --- a/test/fixtures/node_modules/pkgexports/package.json +++ b/test/fixtures/node_modules/pkgexports/package.json @@ -2,7 +2,6 @@ "exports": { ".": "./asdf.js", "./space": "./sp%20ce.js", - "./asdf": "./asdf.js", "./valid-cjs": "./asdf.js", "./sub/": "./" } diff --git a/test/fixtures/pkgexports-missing.mjs b/test/fixtures/pkgexports-missing.mjs deleted file mode 100644 index 7d1d5b2e82..0000000000 --- a/test/fixtures/pkgexports-missing.mjs +++ /dev/null @@ -1,11 +0,0 @@ -export function loadMissing() { - return import('pkgexports/missing'); -} - -export function loadFromNumber() { - return import('pkgexports-number/hidden.js'); -} - -export function loadDot() { - return import('pkgexports'); -} diff --git a/test/fixtures/pkgexports.mjs b/test/fixtures/pkgexports.mjs index 8907ebcb0e..7d642c443e 100644 --- a/test/fixtures/pkgexports.mjs +++ b/test/fixtures/pkgexports.mjs @@ -1,3 +1,12 @@ -export { default as asdf } from 'pkgexports/asdf'; -export { default as asdf2 } from 'pkgexports/sub/asdf.js'; -export { default as space } from 'pkgexports/space'; +import { fileURLToPath } from 'url'; +import { createRequire } from 'module'; + +const rawRequire = createRequire(fileURLToPath(import.meta.url)); + +export async function requireFixture(specifier) { + return { default: rawRequire(specifier ) }; +} + +export function importFixture(specifier) { + return import(specifier); +} |