Fix main-street-tutorial-e2e 'require is not defined' test failures
Problem
The test file tests/e2e/main-street-tutorial-e2e.browser.test.ts uses require() at line 156 to dynamically import getCurrentStep from a game module. Since the project runs in ESM mode (Vite/Vitest), require is not defined, causing all 9 tests in the file to fail.
Fix
Replace the require() call with a top-level import to make it work in ESM context.
Acceptance Criteria
- All 9 tests in
tests/e2e/main-street-tutorial-e2e.browser.test.ts pass
- The module is imported correctly without using
require()
- Full test suite continues to pass (
npm test)
- Build succeeds (
npm run build)
Fix main-street-tutorial-e2e 'require is not defined' test failures
Problem
The test file
tests/e2e/main-street-tutorial-e2e.browser.test.tsusesrequire()at line 156 to dynamically importgetCurrentStepfrom a game module. Since the project runs in ESM mode (Vite/Vitest),requireis not defined, causing all 9 tests in the file to fail.Fix
Replace the
require()call with a top-level import to make it work in ESM context.Acceptance Criteria
tests/e2e/main-street-tutorial-e2e.browser.test.tspassrequire()npm test)npm run build)