Skip to content

v0.3.0

Choose a tag to compare

@9aoy 9aoy released this 27 Aug 11:13
· 754 commits to main since this release
6ca6025

Highlights πŸ’‘

Incremental re-runs in watch mode

Watch mode now supports incremental re-runs. When a test file or its dependencies change, Rstest intelligently re-executes only the affected tests, significantly improving testing efficiency.

Test projects

Support define & run multiple test projects via projects configuration. This allows users to define and run tests across multiple project directories with different configurations, enabling better organization of test suites in monorepo structures.

import { defineConfig } from '@rstest/core';

export default defineConfig({
  projects: [
    // A monorepo: each package directory is a project
    'packages/*',

    // All apps that provide an rstest config file
    'apps/**/rstest.config.ts',

    // A specific project directory
    '<rootDir>/services/auth',

    // A specific project's config file
    './projects/web/rstest.config.ts',
  ],
});

What's Changed

New Features πŸŽ‰

  • feat: re-run on demand in watch mode. by @fi3ework in #475

  • feat: support test projects by @9aoy in #420

  • feat: support onTestFinished hook by @9aoy in #493

  • feat: support onTestFailed hook by @9aoy in #501

  • feat: support restart when project config changed by @9aoy in #514

Bug Fixes 🐞

  • fix: add onTestFinished to testContext by @9aoy in #494
  • fix: use clearScreen instead of clearLogs by @9aoy in #504
  • fix: manualMockRoot in projects by @9aoy in #508
  • fix: compat NO_COLOR env by @9aoy in #509
  • fix: should avoid outputs conflict in projects by @9aoy in #515
  • fix: should not expand diff by default by @9aoy in #516

Document πŸ“–

  • docs: add TestContext by @9aoy in #495
  • docs: add chainable modifiers examples by @9aoy in #500

Other Changes

  • chore: should not clearLogs in debug mode by @9aoy in #496
  • chore(deps): update all non-major dependencies by @renovate[bot] in #497
  • test: avoid repeated killing of exec by @9aoy in #498
  • test: fix unstable concurrent cases with onTestFinished by @9aoy in #499
  • test: fix unawaited promise in tests by @9aoy in #503
  • chore: use isFirstCompile instead of isFirstRun by @9aoy in #506
  • chore: update react example with @testing-library/jest-dom by @9aoy in #510
  • chore(deps): update all non-major dependencies by @renovate[bot] in #511
  • chore: update no rerun log by @9aoy in #513

Full Changelog: v0.2.2...v0.3.0