Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: dynamically generating tests with top-level await and ESM test files #4617

Merged
merged 1 commit into from
Apr 3, 2021

Conversation

juergba
Copy link
Contributor

@juergba juergba commented Apr 2, 2021

Description of the Change

With top-level await test data can be collected in a dynamic and asynchronous way, while the test file is loaded and before the test runner is created. Since ESM files are already loaded in an asynchronous way, no changes to our code base are needed.

Requisite:

  • top-level await: since Node >= v14.8.0
  • ESM (ECMAScript module) test file

@juergba juergba self-assigned this Apr 2, 2021
@juergba juergba added area: documentation anything involving docs or mochajs.org semver-patch implementation requires increase of "patch" version number; "bug fixes" labels Apr 2, 2021
@juergba juergba requested a review from a team April 2, 2021 12:05
@juergba juergba force-pushed the juergba/docs-dynamic branch from 43739a6 to 5b421f0 Compare April 2, 2021 13:18
Copy link
Contributor

@outsideris outsideris left a comment

Choose a reason for hiding this comment

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

Wow! I didn't know that.

docs/index.md Show resolved Hide resolved
@juergba juergba force-pushed the juergba/docs-dynamic branch from 5b421f0 to 951850f Compare April 3, 2021 12:35
@juergba juergba merged commit 8a2da76 into master Apr 3, 2021
@juergba juergba added the area: async related to asynchronous use of Mocha label Apr 3, 2021
@juergba juergba added this to the next milestone Apr 3, 2021
@juergba juergba deleted the juergba/docs-dynamic branch April 3, 2021 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: async related to asynchronous use of Mocha area: documentation anything involving docs or mochajs.org semver-patch implementation requires increase of "patch" version number; "bug fixes"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants