diff --git a/Makefile b/Makefile index 2639b6777..abd1b7226 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,6 @@ debug: REACT_APP_DEBUG=true npm start test: - node metadata_fetch.mjs npm run test deploy-setup: diff --git a/metadata_fetch.mjs b/metadata_fetch.mjs index 56fcff570..7dd18ee7e 100644 --- a/metadata_fetch.mjs +++ b/metadata_fetch.mjs @@ -6,8 +6,12 @@ let metadataUS = null; let metadataUK = null; let metadataCA = null; const __dirname = path.dirname(new URL(import.meta.url).pathname); +// Fix for Windows path issues +const normalizedDirname = __dirname.startsWith("/") + ? __dirname.slice(1) + : __dirname; const filePath = path.join( - __dirname, + normalizedDirname, "src", "__tests__", "__setup__", diff --git a/package.json b/package.json index babfe2ff4..c938192ee 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "scripts": { "start": "react-scripts start", "build": "react-scripts build", + "pretest": "node metadata_fetch.mjs", "test": "jest", "eject": "react-scripts eject", "fix": "eslint --fix --ext js,jsx . && prettier -w .",