chore: split out async-rewriter tests into separate package - #2733
Conversation
This will be a prerequisite for productionizing a new iteration of the async rewriter, such as the one proposed in #1931.
There was a problem hiding this comment.
Pull request overview
This PR extracts the async rewriter’s large Mocha test suite from @mongosh/async-rewriter2 into a new reusable workspace package (@mongosh/async-rewriter-spec) so that alternative async rewriter implementations can be validated against the same spec.
Changes:
- Introduces
@mongosh/async-rewriter-specwith arunTests()helper that hosts the shared async-rewriter test suite. - Refactors
@mongosh/async-rewriter2tests to call the sharedrunTests()suite and exposesAsyncWriteras a named export. - Updates workspace/CI configuration to include the new package and to only generate Evergreen unit-test tasks for packages that define
test-ci.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/async-rewriter2/src/index.ts | Adds a named AsyncWriter export alongside the default export. |
| packages/async-rewriter2/src/async-writer-babel.spec.ts | Replaces the in-file test suite with a call into @mongosh/async-rewriter-spec. |
| packages/async-rewriter2/package.json | Adds @mongosh/async-rewriter-spec as a dev dependency. |
| packages/async-rewriter-spec/tsconfig.json | Adds TS config for the new spec package outputting to lib/. |
| packages/async-rewriter-spec/tsconfig-lint.json | Adds lint TS config including test/ and benchmark/. |
| packages/async-rewriter-spec/test/fixtures/with-domain.js | Adjusts fixture to load runtime support code via an env-provided file path. |
| packages/async-rewriter-spec/src/index.ts | New reusable async-rewriter spec test suite implementation (runTests). |
| packages/async-rewriter-spec/README.md | Documents the purpose of the reusable spec package. |
| packages/async-rewriter-spec/package.json | New package manifest for @mongosh/async-rewriter-spec. |
| packages/async-rewriter-spec/LICENSE | Adds Apache 2.0 license file for the new package. |
| packages/async-rewriter-spec/AUTHORS | Adds AUTHORS file for the new package. |
| packages/async-rewriter-spec/.prettierrc.json | Adds Prettier config reference for the new package. |
| packages/async-rewriter-spec/.prettierignore | Adds Prettier ignore rules for build/test artifacts. |
| packages/async-rewriter-spec/.npmignore | Adds npm ignore rules for the new package. |
| packages/async-rewriter-spec/.mocharc.json | Adds Mocha config for running TS-based specs in the new package. |
| packages/async-rewriter-spec/.gitignore | Adds gitignore entries for build output and local artifacts. |
| packages/async-rewriter-spec/.eslintrc.js | Adds ESLint config for the new package. |
| packages/async-rewriter-spec/.eslintignore | Adds ESLint ignore rules for build output and local artifacts. |
| package.json | Registers packages/async-rewriter-spec in workspaces ordering. |
| package-lock.json | Adds workspace link entries for @mongosh/async-rewriter-spec. |
| mongosh.code-workspace | Adds the new package folder to the workspace and reorders entries. |
| .evergreen/tasks/unit-tests.js | Updates unit-test task generation to use full package.json and require test-ci script. |
| .evergreen.yml | Removes Evergreen unit-test tasks/artifacts related to the testing package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
tc39/test-262 test results 1 files 1 suites 18d 13h 47m 16s ⏱️ For more details on these failures, see this check. Results for commit 11f5a81. |
test262 conformance testsThere has been 45 new failures in commit 04cfb29 compared to the baseline commit (main). |
This will be a prerequisite for productionizing a new iteration of the async rewriter, such as the one proposed in #1931.