-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
AVA 6 watch mode #3218
Merged
Merged
AVA 6 watch mode #3218
Conversation
This file contains 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
novemberborn
force-pushed
the
ava6-watcher
branch
2 times, most recently
from
June 29, 2023 20:27
ef3c72e
to
426ac22
Compare
novemberborn
force-pushed
the
ava6-watcher
branch
9 times, most recently
from
July 2, 2023 07:49
c8317d7
to
31f0bcf
Compare
* Remove undocumented ability to start watch mode via the config. Require the CLI flag instead * Watch mode is no longer 'relatively new' * Add ava.config.mjs to default watcher ignore patterns * Ignore changes to failed-tests file in watcher Logger cleanup: * Remove obsolete clearLogOnNextRun option * Track firstRun for reporter
Restrict @ava/typescript to the ava-3.2 protocol, since the legacy code is not compatible with the ava-6 protocol. Remove brittle tests for the legacy code.
Rely on recursive fs.watch(), rather than Chokidar. On Linux this is supported from Node.js 20 onwards. It won't work for network shares and Docker volume mounts which would require polling, we'll find out if that's a problem or not. (For now, the previous implementation is still available.) Use @vercel/nft to perform static dependency analysis, supporting ESM and CJS imports for JavaScript & TypeScript source files. This is a huge improvement over the previous runtime tracking of CJS imports, which did not support ESM. Rewrite the change handling logic to be easier to follow (though it's still pretty complicated). Improve integration with `@ava/typescript`. The watcher can now detect a change to a TypeScript source file, then wait for the corresponding build output to change before re-running tests.
* Run tests on macOS * Use Bash shell * Run watch mode test separately and serially
novemberborn
force-pushed
the
ava6-watcher
branch
from
July 2, 2023 12:59
31f0bcf
to
5884860
Compare
This was referenced Jul 2, 2023
Closed
This was referenced Jun 20, 2024
This was referenced Sep 12, 2024
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.
Rely on recursive
fs.watch()
, rather than Chokidar. On Linux this is supported from Node.js 20 onwards. It won't work for network shares and Docker volume mounts which would require polling, we'll find out if that's a problem or not.Use
@vercel/nft
to perform static dependency analysis, supporting ESM and CJS imports for JavaScript & TypeScript source files. This is a huge improvement over the previous runtime tracking of CJS imports, which did not support ESM.Rewrite the change handling logic to be easier to follow (though it's still pretty complicated).
Improve integration with
@ava/typescript
. The watcher can now detect a change to a TypeScript source file, then wait for the corresponding build output to change before re-running tests. See avajs/typescript#46.Because this is a big change, and due to the Linux and network share implications, the previous implementation can be enabled:
You will need to manually install
chokidar
however.Tests for the previous implementation have been removed. They've been hard to maintain. We're not expecting to make any / many code changes so hopefully we'll be all right.
Other changes:
ava.config.mjs
to default watcher ignore patterns