npm vite-node 0.31.0
v0.31.0

latest releases: 2.1.1, 2.1.0, 2.1.0-beta.7...
16 months ago

   🚨 Breaking Changes

  • 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.mocked('./path/to/module.js', () => {
      return { originalMethod: mockedMethod }
    })
  • Move assertion declarations to expect package  -  by @sheremet-va in #3294 (cf3af)

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

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

Don't miss a new vite-node release

NewReleases is sending notifications on new releases.