Skip to content

Fix npm test runner on Windows - #11

Open
cedar323 wants to merge 1 commit into
BitgesellOfficial:mainfrom
cedar323:fix/windows-npm-test-runner
Open

Fix npm test runner on Windows#11
cedar323 wants to merge 1 commit into
BitgesellOfficial:mainfrom
cedar323:fix/windows-npm-test-runner

Conversation

@cedar323

@cedar323 cedar323 commented Jun 8, 2026

Copy link
Copy Markdown

Summary

  • replace the POSIX-only npm test command with a small Node runner
  • preserve the existing mocha options while allowing extra CLI arguments to pass through
  • set NODE_ENV=test in a cross-platform way

Verification

  • npm test -- test\errors\rpc-error_test.js --reporter spec passes on Windows
  • git diff --check reports no patch whitespace errors; Git only warns that package.json/test/run-mocha.js will be normalized to CRLF locally

Note: npm run lint -- --quiet currently fails on pre-existing linebreak-style errors across the repository on Windows, unrelated to this change.

@MyTH-zyxeon

Copy link
Copy Markdown

Maintainer-facing review assist for the Bitgesell #39 bounty lane:

I checked current head 24f0ea2103500ff4dbfe42939cdfe7ae1724ce09. The diff is narrow: package.json switches the test script from the POSIX-only NODE_ENV=test mocha $npm_package_options_mocha form to node test/run-mocha.js, and the new runner sets NODE_ENV=test, invokes the local Mocha binary through node, preserves the existing Mocha options (--timeout 20000 --recursive --require should), and forwards extra CLI arguments.

Current visible state: PR is OPEN, MERGEABLE, mergeStateStatus=CLEAN, has no top-level comments or reviews, and no status checks are visible on the PR. It looks like a focused cross-platform test-runner fix rather than a runtime/client behavior change.

Pre-merge checks I would use:

  1. Run the author's Windows command (npm test -- test\errors\rpc-error_test.js --reporter spec) plus the same targeted test on a POSIX shell to confirm argument forwarding stays equivalent.
  2. Run npm test without extra args once, because the runner hardcodes the existing options.mocha value instead of reading npm_package_options_mocha dynamically.
  3. Confirm npm run cover still works, since it shells through nyc ... npm test and will now call the node runner.

No claim/payment action from me here; this is just review-routing support so maintainers can evaluate #11 against the active Bitgesell PR bounty queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants