test: Add support for running the Mocha test suite under Node - #10208
Open
gonfunko wants to merge 13 commits into
Open
test: Add support for running the Mocha test suite under Node#10208gonfunko wants to merge 13 commits into
gonfunko wants to merge 13 commits into
Conversation
…er disposing of a comment
lizschwab
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The basics
The details
Resolves
Proposed Changes
This PR adds support for running the existing Mocha test suite under Node, via
npm run test:mocha:node, as well as in the browser via the existingnpm run test:mocha:interactive. This change was LLM-assisted. The vast majority of the test suite was unchanged; a single-digit number of tests that depended upon specific layout details or focus event behavior were moved to the browser test suite (npm run test:browser). Additionally, the tests now import sinon/chai/etc by Node module resolution, rather than by relative path to the node_modules folder. Reviewing commit-by-commit is recommended.Reason for Changes
Running the tests in the browser is slow, tricky in CI, and confusing to LLMs. It also means we have very poor test coverage of running Blockly headless/server-side, since before this the only test we had that ran under Node was a minimal smoketest of serialization. Now, 3956 testcases run and pass under both Node and within the browser. Several changes were made to achieve this:
Test Coverage
npm run test:mocha:interactive,npm run test:mocha:node, andnpm run test:browserall pass, exercising the Mocha suite in the browser, in Node, and the browser-specific suite in the browser.