Skip to content

Releases: vitest-dev/vitest

v0.32.1

16 Jun 12:21
Compare
Choose a tag to compare

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

v0.32.0

06 Jun 17:03
Compare
Choose a tag to compare

   🚨 Breaking Changes

  • Throw an error, if the module cannot be resolved  -  by @sheremet-va in #3307 (1ad63)
    • Vitest used to fall back to the original import when it could not resolve it to the file path or the virtual module. This leads to hard-to-find module graph mismatches if you had incorrect alias or relied on relative imports to be resolved to the project root (which is usual behavior in TypeScript) because the code accidentally "worked". With this release, Vitest will now throw an error if it cannot resolve the module - there are possible edge cases that are not covered yet, so if you have any problems with this, please open a separate issue with reproduction.
  • Improve globs  -  by @nickmccurdy in #3392 (19ecc)
    • Vitest now has glob patterns similar to Jest for better compatibility. It's possible that some files will be considered test files when previously they were not. For example, Vitest now considers test.js to be a test file. Also any file in __tests__ is now considered to be a test, not just files with test or spec suffix.
  • Add @vitest/coverage-v8 package  -  by @AriPerkkio in #3339 (82112)
    • Vitest now uses v8 code coverage directly for better performance. @vitest/coverage-c8 is deprecated as Vitest no longer uses c8 package for coverage output. It will not be updated anymore, and Vitest will fail in the next version if the user has c8 as their coverage provider. Please, install the new @vitest/coverage-v8 package if you previously used @vitest/coverage-c8.
  • mocker: Don't restore mock to the original if the module is automocked  -  by @sheremet-va in #3518 (c1004)
    • spy.mockRestore on auto-mocked named exports will no longer restore their implementation to the actual function. This behavior better matches what Jest does.

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

v0.31.4

01 Jun 09:59
Compare
Choose a tag to compare

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

v0.31.3

31 May 14:49
Compare
Choose a tag to compare

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

v0.31.2

30 May 13:04
Compare
Choose a tag to compare

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

v0.31.1

17 May 14:23
Compare
Choose a tag to compare

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

v0.31.0

03 May 18:07
Compare
Choose a tag to compare

   🚨 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

v0.30.1

11 Apr 11:24
Compare
Choose a tag to compare

   🐞 Bug Fixes

    View changes on GitHub

v0.30.0

09 Apr 13:38
Compare
Choose a tag to compare

   🚨 Breaking Changes

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

v0.29.8

28 Mar 13:11
Compare
Choose a tag to compare

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub