From 6e1d464358146af4f31969a3dd1b320bb2fe97dd Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Thu, 4 Jul 2024 11:17:28 +0200 Subject: [PATCH] revert path.sep --- package.json | 2 +- src/analyze.ts | 3 ++- test/unit.test.js | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 80cd5403..50d2111d 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "prepublishOnly": "tsc && rm out/utils/*.d.ts && rm out/tsconfig.tsbuildinfo", "prettier-check": "prettier --check .", "prettier-fix": "prettier --write .", - "test": "jest --verbose", + "test": "jest", "test-verbose": "tsc --sourceMap && jest --verbose --coverage --globals \"{\\\"coverage\\\":true}\"" }, "prettier": "@vercel/style-guide/prettier", diff --git a/src/analyze.ts b/src/analyze.ts index 833a52bf..9cd518d9 100644 --- a/src/analyze.ts +++ b/src/analyze.ts @@ -900,6 +900,7 @@ export default async function analyze( node.arguments[0].type === 'Literal' ) { const pathOrSpecifier = node.arguments[0].value; + console.log('module.register', pathOrSpecifier); // It's a relative URL if (pathOrSpecifier.startsWith('.')) { // Compute the parentURL if it's statically analyzable @@ -926,7 +927,7 @@ export default async function analyze( // Make it a proper relative path const relativeSrcPath = srcPath.startsWith('.') ? srcPath - : '.' + path.sep + srcPath; + : './' + srcPath; imports.add(relativeSrcPath); } diff --git a/test/unit.test.js b/test/unit.test.js index 0bf62b1b..d21861bf 100644 --- a/test/unit.test.js +++ b/test/unit.test.js @@ -72,7 +72,6 @@ for (const { testName, isRoot } of unitTests) { process.platform === 'win32' && (isRoot || skipOnWindows.includes(testName)) ) { - console.log(`Skipping unit test on Windows: ${testSuffix}`); continue; } if (process.platform === 'darwin' && skipOnMac.includes(testName)) {