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

AVA 6 watch mode #3218

Merged
merged 5 commits into from Jul 2, 2023
Merged

AVA 6 watch mode #3218

merged 5 commits into from Jul 2, 2023

Commits on Jul 2, 2023

  1. Minor changes to watch mode

    * 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
    novemberborn committed Jul 2, 2023
    Configuration menu
    Copy the full SHA
    c166074 View commit details
    Browse the repository at this point in the history
  2. Require opt-in to AVA 5's watcher and separate install of chokidar

    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.
    novemberborn committed Jul 2, 2023
    Configuration menu
    Copy the full SHA
    9cd5ff8 View commit details
    Browse the repository at this point in the history
  3. Add a brand new watcher

    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.
    novemberborn committed Jul 2, 2023
    Configuration menu
    Copy the full SHA
    e0fdd2d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0330ce0 View commit details
    Browse the repository at this point in the history
  5. Set up CI to test the new watcher

    * Run tests on macOS
    * Use Bash shell
    * Run watch mode test separately and serially
    novemberborn committed Jul 2, 2023
    Configuration menu
    Copy the full SHA
    5884860 View commit details
    Browse the repository at this point in the history