From 927c972053d40c237dadc1c9c13902ce5cf7b5e1 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Sun, 5 Jan 2025 17:21:49 +0100 Subject: [PATCH] Simplify --- package.json | 2 +- test/unit/import.spec.mjs | 8 ++++---- test/unit/require.spec.cjs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 58ab66b..fa0ee5e 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "test:bundler:rollup": "cd test/rollup && npm install && npm test", "test:bundler:webpack": "cd test/webpack && npm install && npm test", "test:types": "tsc -p ./test/types/tsconfig.json", - "test:unit": "node --experimental-import-meta-resolve node_modules/jasmine/bin/jasmine.js --config=test/unit/jasmine.json", + "test:unit": "jasmine --config=test/unit/jasmine.json", "lint": "eslint \"*.mjs\" \"src/**/*.ts\"", "build": "npm run build:bundle && npm run build:types", "build:bundle": "rollup -c", diff --git a/test/unit/import.spec.mjs b/test/unit/import.spec.mjs index 489bea7..961dd7e 100644 --- a/test/unit/import.spec.mjs +++ b/test/unit/import.spec.mjs @@ -39,8 +39,8 @@ function testPolyfill(id, expectedId) { afterEach(() => { global.ReadableStream = oldGlobalReadableStream; }); - it(`resolves to ${expectedId}`, async () => { - await testResolve(id, expectedId); + it(`resolves to ${expectedId}`, () => { + testResolve(id, expectedId); }); // FIXME Remove from import() cache first somehow? // it('loads correctly', async () => { @@ -50,7 +50,7 @@ function testPolyfill(id, expectedId) { // }); } -async function testResolve(id, expectedId) { - const resolved = (await import.meta.resolve(id)).toString(); +function testResolve(id, expectedId) { + const resolved = import.meta.resolve(id); expect(resolved.endsWith(expectedId)).toBeTrue(); } diff --git a/test/unit/require.spec.cjs b/test/unit/require.spec.cjs index c57b8bc..d9dc203 100644 --- a/test/unit/require.spec.cjs +++ b/test/unit/require.spec.cjs @@ -53,6 +53,6 @@ function testPolyfill(id, expectedId) { function requireUncached(module) { delete require.cache[require.resolve(module)]; - // eslint-disable-next-line global-require + // eslint-disable-next-line @typescript-eslint/no-require-imports return require(module); }