Skip to content

v0.31.0

Compare
Choose a tag to compare
@github-actions github-actions released this 03 May 18:07
· 990 commits to main since this release

   🚨 Breaking Changes

  • Remove browser from allowed pools inside poolMatchGlob config option. Please, use Vitest workspaces for running tests in the browser.

  • Move assertion declarations to expect package  -  by @sheremet-va in #3294 (cf3af)

    • The change should be minor:
    - declare namespace Vi {
    + declare module 'vitest' {
       interface Assertion<T = any> extends CustomMatchers<T> {}
       interface AsymmetricMatchersContaining extends CustomMatchers {}
    }

   🚀 Features

  • Update mock implementation to support ESM runtime, introduce "vi.hoisted"  -  by @sheremet-va in #3258 (0c09a)
    • Bypass ESM import order restriction with vi.hoisted to run code before imports are executed:
    vi.hoisted(() => vi.setSystemTime(new Date(2022, 1, 1)))
    You can also use it to pass variables to vi.mock:
    const { mockedMethod } = vi.hoisted(() => {
      return { mockedMethod: vi.fn() }
    })   
    vi.mock('./path/to/module.js', () => {
      return { originalMethod: mockedMethod }
    })
  • Add repeat method to tests  -  by @samkevin1 in #2652 (7c8f0)
  • Add an option to hide skipped test lines  -  by @g4rry420 and @sheremet-va in #2745 (9bdb1)
  • coverage: Watermarks for c8  -  by @AriPerkkio in #3254 (730af)
  • ui: Add html coverage  -  by @userquin and @sheremet-va in #3071 (e24cd)
  • watch: Test run cancelling, feat: --bail option for cancelling test run  -  by @AriPerkkio in #3163 (8d460)

   🐞 Bug Fixes

    View changes on GitHub