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:
2026-08-27 15:52:04 +02:00
parent 8d14a4f23e
commit 898b8d74af
6 changed files with 25 additions and 9 deletions
+11
View File
@@ -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",