Tags

Tags give the ability to mark specific points in history as being important
  • v1.2.0

    protected
    This release introduces snapshot-based test isolation, giving each test full isolation without paying the cost of a full site reinstall every time.
    
    ✨ New Features
    
    ## isolatedPerTestSnapshot fixture
    
    A new fixture that installs the Drupal site once per worker, then restores a database/filesystem snapshot before each test instead of reinstalling. You get the same per-test isolation guarantees as isolatedPerTest, but tests run much faster in situations where there is a heavy install profile, recipes, or other long-running repeated processes.
    
    - Requires sqlite (DRUPAL_TEST_DB_URL set to a sqlite:// URL). Snapshot/restore works by copying the standalone sqlite DB file and managed file directories; with any other database the fixture throws immediately.
    - Worker-scoped configuration via test.use({ ... }):
    
    | Option               | Default   | Description                                                                              |
    |----------------------|-----------|------------------------------------------------------------------------------------------|
    | installProfile       | 'minimal' | Install profile passed to Drupal.install()                                               |
    | modules              | []        | Modules installed declaratively before the snapshot                                      |
    | enableTestExtensions | false     | Make Drupal's test-only modules discoverable                                             |
    | setup                | undefined | Hook ({}, { drupal, page }) => Promise<void> for arbitrary setup baked into the snapshot |
    | snapshotCache        | false     | Reuse a worker's snapshot across runs while code is unchanged                            |
    
    
    - Cache is keyed by a fingerprint of the installProfile, modules, enableTestExtensions, resolved DB/base URL, and the git working-tree state of the Drupal root
    - *.spec.ts files are excluded from the fingerprint by default (configurable via testFileGlobs), so editing tests reuses the cache while changing source rebuilds it
    - Stale snapshots are pruned automatically; only the current fingerprint is kept
    - Requires git (or an explicit key), otherwise caching disables itself with a warning rather than risk a stale snapshot
    - Override at runtime with `DRUPAL_TEST_SNAPSHOT_CACHE=0|1 `(handy: on locally, off in CI) or `DRUPAL_TEST_SNAPSHOT_CACHE_DIR`
    
    ### setup hook for snapshot tests
    
    A worker-scoped setup hook lets you bake arbitrary setup (beyond profile/modules) into the snapshot.
    
    ## Screenshots on setup failure
    
    When a fixture's setup phase throws, a screenshot is now captured automatically to aid debugging.
    
    ## Other Changes
    
    - File-wide fixture options can now be passed through test.use({ installProfile, modules, enableTestExtensions }).
    - Updated snapshot cache and support for Drupal 11.4.
  • v1.1.2

    protected
    Add fixes for multiple data-drupal-messages and disabled performance checkboxes
  • v1.1.1

    protected
    Issue #3581272: More robust module installer
  • v1.1.0

    protected
    Adds `Drupal.enableTestExtensions()` and support for test extensions in `Drupal.installModules()`
  • v1.0.2

    protected
    Initial release
  • v1.0.1

    protected
    Initial release