Status: ✅ Resolved on main — fixed by PR #157, commit 7073d25. Verified against a freshly-fetched origin/main before editing this issue.
Description
npm test in engine-bridge could not run at all in some environments (Windows/Git Bash confirmed). The script invoked the Jest binary shim directly with node, but that shim is a POSIX shell script, not JavaScript.
Affected Component
engine-bridge/package.json
Original Behavior (Bug)
"test": "node --experimental-vm-modules node_modules/.bin/jest --runInBand"
Running npm test threw:
node_modules\.bin\jest:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
because node was trying to parse a #!/bin/sh script as JavaScript.
Expected Behavior
npm test runs the full Jest suite regardless of platform or which shim npm generated for .bin/jest.
Root Cause
node_modules/.bin/jest is a POSIX shell wrapper (#!/bin/sh) around Jest's real entry point. Invoking it with node <path> only works where the resolved .bin/jest happens to be a JS shim, which isn't guaranteed across npm versions/platforms.
Resolution
package.json's test script now invokes Jest's actual JS entry point directly, which is portable since it's executed via node rather than a shell:
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand"
Confirmed present on main at time of writing.
Verification
$ git show origin/main:engine-bridge/package.json | grep '"test"'
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand",
$ npm test
Test Suites: 10 passed, 10 total
Tests: 64 passed, 64 total
Definition of Done
Description
npm testinengine-bridgecould not run at all in some environments (Windows/Git Bash confirmed). The script invoked the Jest binary shim directly withnode, but that shim is a POSIX shell script, not JavaScript.Affected Component
engine-bridge/package.jsonOriginal Behavior (Bug)
Running
npm testthrew:because
nodewas trying to parse a#!/bin/shscript as JavaScript.Expected Behavior
npm testruns the full Jest suite regardless of platform or which shim npm generated for.bin/jest.Root Cause
node_modules/.bin/jestis a POSIX shell wrapper (#!/bin/sh) around Jest's real entry point. Invoking it withnode <path>only works where the resolved.bin/jesthappens to be a JS shim, which isn't guaranteed across npm versions/platforms.Resolution
package.json'stestscript now invokes Jest's actual JS entry point directly, which is portable since it's executed vianoderather than a shell:Confirmed present on
mainat time of writing.Verification
npm testruns and all 64 tests pass on Windows and Linux/macOS (Windows verified directly; Linux/macOS rely on the same portablenode <file>.jsinvocation, which has no platform-specific shim dependency).Definition of Done
main(PR Fix merge-corrupted engine-core, jest/eslint setup, repo cruft #157,7073d25).engine-bridge's test suite is green.