test(e2e): add jiti devDep, derive repo root from import.meta.url
'npm run test:e2e' was failing before it even started:
the four tests import { createJiti } from 'jiti' but jiti was never
declared in package.json, so Node threw ERR_MODULE_NOT_FOUND on the
first import. Adding it to devDependencies fixes the loader.
The same tests hard-coded the original developer's path
('/home/moze/Sorgenti/pi-imgen'), so even with jiti installed they
would have failed on any other checkout. Replacing it with
dirname(dirname(dirname(fileURLToPath(import.meta.url)))) lets the
suite run from wherever the repo is cloned.
This commit is contained in:
Generated
+11
@@ -13,6 +13,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.14.0",
|
||||
"jiti": "^2.4.0",
|
||||
"typescript": "^5.6.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -3515,6 +3516,16 @@
|
||||
"node": ">= 4"
|
||||
}
|
||||
},
|
||||
"node_modules/jiti": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz",
|
||||
"integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"jiti": "lib/jiti-cli.mjs"
|
||||
}
|
||||
},
|
||||
"node_modules/json-bigint": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz",
|
||||
|
||||
Reference in New Issue
Block a user