Skip to content

try removing mocha in favor of node test runner - #320

Draft
vkarpov15 wants to merge 5 commits into
mainfrom
vkarpov15/remove-mocha
Draft

try removing mocha in favor of node test runner#320
vkarpov15 wants to merge 5 commits into
mainfrom
vkarpov15/remove-mocha

Conversation

@vkarpov15

Copy link
Copy Markdown
Collaborator

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.ts and test/b.test.ts will run in parallel, but tests within those files will run in series. To avoid that, I set --test-concurrency=1

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

Copilot AI review requested due to automatic review settings August 3, 2026 20:07
@vkarpov15
vkarpov15 requested a review from a team as a code owner August 3, 2026 20:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from node:test and replace Mocha-only patterns like this.skip().
  • Add a bin/run-tests.ts wrapper and update scripts/docs to support -g/--grep via 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
vkarpov15 marked this pull request as draft August 3, 2026 20:24
Base automatically changed from vkarpov15/typescript-7 to main August 13, 2026 15:25
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