try removing mocha in favor of node test runner - #320
Draft
vkarpov15 wants to merge 5 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the repo’s TypeScript test suite from Mocha to Node’s built-in node:test runner, aiming to reduce future TypeScript compatibility risk while keeping cross-file test parallelism disabled via --test-concurrency=1.
Changes:
- Remove Mocha typings/dependencies and update TS config accordingly.
- Update test files to import
describe/it/hooks fromnode:testand replace Mocha-only patterns likethis.skip(). - Add a
bin/run-tests.tswrapper and update scripts/docs to support-g/--grepvia Node’s--test-name-pattern.
Reviewed changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Drops Mocha typings so tests compile against Node types only. |
| package.json | Removes Mocha deps/config and switches test* scripts to the new Node test runner wrapper. |
| DEVGUIDE.md | Documents running a subset of tests via -g/--grep. |
| bin/run-tests.ts | New wrapper that translates Mocha-style -g/--grep into Node --test-name-pattern and runs node --test. |
| tests/udt/udtDefinitionsFromSchema.test.ts | Imports describe/it from node:test. |
| tests/udt/convertSchemaToUDTColumns.test.ts | Imports describe/it from node:test. |
| tests/tableDefinitionFromSchema.test.ts | Imports describe/it from node:test. |
| tests/serialize.test.ts | Imports describe/it from node:test. |
| tests/parseUri.test.ts | Imports describe/it from node:test. |
| tests/mongooseFixtures.ts | Switches teardown registration to after from node:test. |
| tests/driver/tables.vector.test.ts | Switches hooks to node:test and uses suite-level { skip: ... } instead of this.skip(). |
| tests/driver/tables.test.ts | Switches hooks to node:test. |
| tests/driver/tables.driver.test.ts | Switches hooks to node:test. |
| tests/driver/tables.api.test.ts | Switches hooks to node:test and removes Mocha-only timeout usage. |
| tests/driver/collections.driver.test.ts | Switches hooks to node:test and removes Mocha-only timeout usage. |
| tests/driver/collections.api.test.ts | Switches hooks to node:test and uses suite-level { skip: ... } / t.skip() patterns. |
| tests/createAstraUri.test.ts | Imports describe/it from node:test. |
| tests/convertSchemaToColumns.test.ts | Switches hooks to node:test. |
| tests/collections/options.test.ts | Switches hooks to node:test and removes Mocha-only timeout usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vkarpov15
marked this pull request as draft
August 3, 2026 20:24
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.
What this PR does:
Test out removing mocha in favor of Node test runner to minimize risk of any future compatibility issues with TypeScript. Big caveat: Node test runner runs tests from different test files in parallel by default, e.g.
test/a.test.tsandtest/b.test.tswill run in parallel, but tests within those files will run in series. To avoid that, I set--test-concurrency=1Which issue(s) this PR fixes:
Fixes #
Checklist