Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasBuelens committed Jan 5, 2025
1 parent 43917f9 commit 927c972
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions test/unit/import.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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();
}
2 changes: 1 addition & 1 deletion test/unit/require.spec.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 927c972

Please sign in to comment.