Skip to content

Upgrading vitest 0.1 to 0.2

Review needed0.1.27 → 0.2.8New9Changed1Fixed21

Review neededUpgrade verdict

1 behavior change.

  • vite-node: cache module fetch.
Nothing to change

No breaking, platform, security or deprecated items in this range.

Nothing in this upgrade needs a code or configuration change.

Generated by DepDelta from published .d.ts files. Not mixed with prose notes.

  • removed: call Chai.ExpectStatic<T>(actual: T, message?: string): VitestAssertion<T>
  • removed: interface Chai.ExpectStatic extends AsymmetricMatchersContaining
  • removed: interface Chai.JestAssertion<T = any>
  • removed: interface Chai.VitestAssertion<T = any> extends VitestifyAssertion<Assertion>, JestAssertion<T>
  • removed: method Chai.ExpectStatic.addSnapshotSerializer(plugin: Plugin): void
  • removed: method Chai.ExpectStatic.any(constructor: unknown): Any
  • removed: method Chai.ExpectStatic.anything(): Anything
  • removed: method Chai.ExpectStatic.assertions(expected: number): void
  • removed: method Chai.ExpectStatic.extend(expects: MatchersObject): void
  • removed: method Chai.ExpectStatic.getState(): MatcherState
  • removed: method Chai.ExpectStatic.hasAssertions(): void
  • removed: method Chai.ExpectStatic.setState(state: Partial<MatcherState>): void
  • removed: method Chai.JestAssertion.lastCalledWith<E extends any[]>(...args: E): void
  • removed: method Chai.JestAssertion.lastReturnedWith<E>(value: E): void
  • removed: method Chai.JestAssertion.matchSnapshot(message?: string): void
  • removed: method Chai.JestAssertion.matchSnapshot<U extends { [P in keyof T]: any }>(snapshot: Partial<U>, message?: string): void
  • removed: method Chai.JestAssertion.nthCalledWith<E extends any[]>(nthCall: number, ...args: E): void
  • removed: method Chai.JestAssertion.nthReturnedWith<E>(nthCall: number, value: E): void
  • removed: method Chai.JestAssertion.toBe<E>(expected: E): void
  • removed: method Chai.JestAssertion.toBeCalled(): void
  • removed: method Chai.JestAssertion.toBeCalledTimes(times: number): void
  • removed: method Chai.JestAssertion.toBeCalledWith<E extends any[]>(...args: E): void
  • removed: method Chai.JestAssertion.toBeCloseTo(number: number, numDigits?: number): void
  • removed: method Chai.JestAssertion.toBeDefined(): void
  • removed: method Chai.JestAssertion.toBeFalsy(): void
  • removed: method Chai.JestAssertion.toBeGreaterThan(num: number): void
  • removed: method Chai.JestAssertion.toBeGreaterThanOrEqual(num: number): void
  • removed: method Chai.JestAssertion.toBeInstanceOf<E>(expected: E): void
  • removed: method Chai.JestAssertion.toBeLessThan(num: number): void
  • removed: method Chai.JestAssertion.toBeLessThanOrEqual(num: number): void
  • removed: method Chai.JestAssertion.toBeNaN(): void
  • removed: method Chai.JestAssertion.toBeNull(): void
  • removed: method Chai.JestAssertion.toBeTruthy(): void
  • removed: method Chai.JestAssertion.toBeUndefined(): void
  • removed: method Chai.JestAssertion.toContain<E>(item: E): void
  • removed: method Chai.JestAssertion.toContainEqual<E>(item: E): void
  • removed: method Chai.JestAssertion.toEqual<E>(expected: E): void
  • removed: method Chai.JestAssertion.toHaveBeenCalled(): void
  • removed: method Chai.JestAssertion.toHaveBeenCalledOnce(): void
  • removed: method Chai.JestAssertion.toHaveBeenCalledTimes(times: number): void
  • removed: method Chai.JestAssertion.toHaveBeenCalledWith<E extends any[]>(...args: E): void
  • removed: method Chai.JestAssertion.toHaveBeenLastCalledWith<E extends any[]>(...args: E): void
  • removed: method Chai.JestAssertion.toHaveBeenNthCalledWith<E extends any[]>(n: number, ...args: E): void
  • removed: method Chai.JestAssertion.toHaveLastReturnedWith<E>(value: E): void
  • removed: method Chai.JestAssertion.toHaveLength(length: number): void
  • removed: method Chai.JestAssertion.toHaveNthReturnedWith<E>(nthCall: number, value: E): void
  • removed: method Chai.JestAssertion.toHaveProperty<E>(property: string, value?: E): void
  • removed: method Chai.JestAssertion.toHaveReturned(): void
  • removed: method Chai.JestAssertion.toHaveReturnedTimes(times: number): void
  • removed: method Chai.JestAssertion.toHaveReturnedWith<E>(value: E): void
  • removed: method Chai.JestAssertion.toMatch(expected: string | RegExp): void
  • removed: method Chai.JestAssertion.toMatchInlineSnapshot(snapshot?: string, message?: string): void
  • removed: method Chai.JestAssertion.toMatchInlineSnapshot<U extends { [P in keyof T]: any }>(properties: Partial<U>, snapshot?: string, message?: string): void
  • removed: method Chai.JestAssertion.toMatchObject<E extends {} | any[]>(expected: E): void
  • removed: method Chai.JestAssertion.toMatchSnapshot(message?: string): void
  • removed: method Chai.JestAssertion.toMatchSnapshot<U extends { [P in keyof T]: any }>(snapshot: Partial<U>, message?: string): void
  • removed: method Chai.JestAssertion.toReturn(): void
  • removed: method Chai.JestAssertion.toReturnTimes(times: number): void
  • removed: method Chai.JestAssertion.toReturnWith<E>(value: E): void
  • removed: method Chai.JestAssertion.toStrictEqual<E>(expected: E): void
  • removed: method Chai.JestAssertion.toThrow(expected?: string | Constructable | RegExp | Error): void
  • removed: method Chai.JestAssertion.toThrowError(expected?: string | Constructable | RegExp | Error): void
  • removed: method Chai.JestAssertion.toThrowErrorMatchingInlineSnapshot(snapshot?: string, message?: string): void
  • removed: method Chai.JestAssertion.toThrowErrorMatchingSnapshot(message?: string): void
  • removed: method Chai.VitestAssertion.chaiEqual<E>(expected: E): void
  • removed: namespace Chai
  • removed: property Chai.ExpectStatic.not: AsymmetricMatchersContaining
  • removed: property Chai.VitestAssertion.rejects: Promisify<VitestAssertion<T>>
  • removed: property Chai.VitestAssertion.resolves: Promisify<VitestAssertion<T>>
  • removed: type Chai.VitestifyAssertion<A> = { [K in keyof A]: A[K] extends Assertion ? VitestAssertion<any> : A[K] extends (...args: any[]) => any ? A[K] : VitestifyAssertion<A[K]> }
  • added: call Vi.ExpectStatic<T>(actual: T, message?: string): Vi.Assertion<T>
  • added: interface Vi.Assertion<T = any> extends VitestAssertion<Chai.Assertion>, JestAssertion<T>
  • added: interface Vi.ExpectStatic extends Chai.ExpectStatic, AsymmetricMatchersContaining
  • added: interface Vi.JestAssertion<T = any> extends jest.Matchers<void, T>
  • added: interface jest.Matchers<R, T = {}>
  • added: method Vi.ExpectStatic.addSnapshotSerializer(plugin: Plugin): void
  • added: method Vi.ExpectStatic.any(constructor: unknown): Any
  • added: method Vi.ExpectStatic.anything(): Anything
  • added: method Vi.ExpectStatic.assertions(expected: number): void
  • added: method Vi.ExpectStatic.extend(expects: MatchersObject): void
  • added: method Vi.ExpectStatic.getState(): MatcherState
  • added: method Vi.ExpectStatic.hasAssertions(): void
  • added: method Vi.ExpectStatic.setState(state: Partial<MatcherState>): void
  • added: method Vi.JestAssertion.lastCalledWith<E extends any[]>(...args: E): void
  • added: method Vi.JestAssertion.lastReturnedWith<E>(value: E): void
  • added: method Vi.JestAssertion.matchSnapshot(message?: string): void
  • added: method Vi.JestAssertion.matchSnapshot<U extends { [P in keyof T]: any }>(snapshot: Partial<U>, message?: string): void
  • added: method Vi.JestAssertion.nthCalledWith<E extends any[]>(nthCall: number, ...args: E): void
  • added: method Vi.JestAssertion.nthReturnedWith<E>(nthCall: number, value: E): void
  • added: method Vi.JestAssertion.toBe<E>(expected: E): void
  • added: method Vi.JestAssertion.toBeCalled(): void
  • added: method Vi.JestAssertion.toBeCalledTimes(times: number): void
  • added: method Vi.JestAssertion.toBeCalledWith<E extends any[]>(...args: E): void
  • added: method Vi.JestAssertion.toBeCloseTo(number: number, numDigits?: number): void
  • added: method Vi.JestAssertion.toBeDefined(): void
  • added: method Vi.JestAssertion.toBeFalsy(): void
  • added: method Vi.JestAssertion.toBeGreaterThan(num: number): void
  • added: method Vi.JestAssertion.toBeGreaterThanOrEqual(num: number): void
  • added: method Vi.JestAssertion.toBeInstanceOf<E>(expected: E): void
  • added: method Vi.JestAssertion.toBeLessThan(num: number): void
  • added: method Vi.JestAssertion.toBeLessThanOrEqual(num: number): void
  • added: method Vi.JestAssertion.toBeNaN(): void
  • added: method Vi.JestAssertion.toBeNull(): void
  • added: method Vi.JestAssertion.toBeTruthy(): void
  • added: method Vi.JestAssertion.toBeUndefined(): void
  • added: method Vi.JestAssertion.toContain<E>(item: E): void
  • added: method Vi.JestAssertion.toContainEqual<E>(item: E): void
  • added: method Vi.JestAssertion.toEqual<E>(expected: E): void
  • added: method Vi.JestAssertion.toHaveBeenCalled(): void
  • added: method Vi.JestAssertion.toHaveBeenCalledOnce(): void
  • added: method Vi.JestAssertion.toHaveBeenCalledTimes(times: number): void
  • added: method Vi.JestAssertion.toHaveBeenCalledWith<E extends any[]>(...args: E): void
  • added: method Vi.JestAssertion.toHaveBeenLastCalledWith<E extends any[]>(...args: E): void
  • added: method Vi.JestAssertion.toHaveBeenNthCalledWith<E extends any[]>(n: number, ...args: E): void
  • added: method Vi.JestAssertion.toHaveLastReturnedWith<E>(value: E): void
  • added: method Vi.JestAssertion.toHaveLength(length: number): void
  • added: method Vi.JestAssertion.toHaveNthReturnedWith<E>(nthCall: number, value: E): void
  • added: method Vi.JestAssertion.toHaveProperty<E>(property: string, value?: E): void
  • added: method Vi.JestAssertion.toHaveReturned(): void
  • added: method Vi.JestAssertion.toHaveReturnedTimes(times: number): void
  • added: method Vi.JestAssertion.toHaveReturnedWith<E>(value: E): void
  • added: method Vi.JestAssertion.toMatch(expected: string | RegExp): void
  • added: method Vi.JestAssertion.toMatchInlineSnapshot(snapshot?: string, message?: string): void
  • added: method Vi.JestAssertion.toMatchInlineSnapshot<U extends { [P in keyof T]: any }>(properties: Partial<U>, snapshot?: string, message?: string): void
  • added: method Vi.JestAssertion.toMatchObject<E extends {} | any[]>(expected: E): void
  • added: method Vi.JestAssertion.toMatchSnapshot(message?: string): void
  • added: method Vi.JestAssertion.toMatchSnapshot<U extends { [P in keyof T]: any }>(snapshot: Partial<U>, message?: string): void
  • added: method Vi.JestAssertion.toReturn(): void
  • added: method Vi.JestAssertion.toReturnTimes(times: number): void
  • added: method Vi.JestAssertion.toReturnWith<E>(value: E): void
  • added: method Vi.JestAssertion.toStrictEqual<E>(expected: E): void
  • added: method Vi.JestAssertion.toThrow(expected?: string | Constructable | RegExp | Error): void
  • added: method Vi.JestAssertion.toThrowError(expected?: string | Constructable | RegExp | Error): void
  • added: method Vi.JestAssertion.toThrowErrorMatchingInlineSnapshot(snapshot?: string, message?: string): void
  • added: method Vi.JestAssertion.toThrowErrorMatchingSnapshot(message?: string): void
  • added: namespace Vi
  • added: namespace jest
  • added: property Vi.Assertion.rejects: Promisify<Assertion<T>>
  • added: property Vi.Assertion.resolves: Promisify<Assertion<T>>
  • added: property Vi.ExpectStatic.not: AsymmetricMatchersContaining
  • added: type Vi.VitestAssertion<A> = { [K in keyof A]: A[K] extends Chai.Assertion ? Assertion<any> : A[K] extends (...args: any[]) => any ? A[K] : VitestAssertion<A[K]> }
  • removed: call JestMockCompatFn(...args: TArgs): TReturns
  • removed: export { Spy } from 'tinyspy'
  • removed: export { SpyFn } from 'tinyspy'
  • removed: function spyOn<T, S extends Properties<Required<T>>>(obj: T, methodName: S, accesType: 'get'): JestMockCompat<[], T[S]>
  • removed: interface JestMockCompat<TArgs extends any[] = any[], TReturns = any>
  • removed: interface JestMockCompatFn<TArgs extends any[] = any, TReturns = any> extends JestMockCompat<TArgs, TReturns>
  • removed: interface RawSourceMap extends StartOfSourceMap
  • removed: interface StartOfSourceMap
  • removed: method JestMockCompat.getMockImplementation(): ((...args: TArgs) => TReturns) | undefined
  • removed: method JestMockCompat.getMockName(): string
  • removed: method JestMockCompat.mockClear(): this
  • removed: method JestMockCompat.mockImplementation(fn: ((...args: TArgs) => TReturns) | (() => Promise<TReturns>)): this
  • removed: method JestMockCompat.mockImplementationOnce(fn: ((...args: TArgs) => TReturns) | (() => Promise<TReturns>)): this
  • removed: method JestMockCompat.mockName(n: string): this
  • removed: method JestMockCompat.mockRejectedValue(obj: any): this
  • removed: method JestMockCompat.mockRejectedValueOnce(obj: any): this
  • removed: method JestMockCompat.mockReset(): this
  • removed: method JestMockCompat.mockResolvedValue(obj: Awaited<TReturns>): this
  • removed: method JestMockCompat.mockResolvedValueOnce(obj: Awaited<TReturns>): this
  • removed: method JestMockCompat.mockRestore(): void
  • removed: method JestMockCompat.mockReturnThis(): this
  • removed: method JestMockCompat.mockReturnValue(obj: TReturns): this
  • removed: method JestMockCompat.mockReturnValueOnce(obj: TReturns): this
  • removed: property JestMockCompat.mock: JestMockCompatContext<TArgs, TReturns>
  • removed: property RawSourceMap.mappings: string
  • removed: property RawSourceMap.names: string[]
  • removed: property RawSourceMap.sources: string[]
  • removed: property RawSourceMap.sourcesContent?: string[]
  • removed: property RawSourceMap.version: string
  • removed: property StartOfSourceMap.file?: string
  • removed: property StartOfSourceMap.sourceRoot?: string
  • removed: type FetchFunction = (id: string) => Promise<{ code?: string; externalize?: string }>
  • removed: type TestCollector = ChainableFunction<'concurrent' | 'only' | 'skip' | 'todo' | 'fails', [name: string, fn?: TestFunction, timeout?: number], void>
  • removed: type TestFactory = (test: (name: string, fn: TestFunction) => void) => Awaitable<void>
  • changed: const describe: ChainableFunction<'skip' | 'only' | 'todo' | 'concurrent', [name: string, factory?: TestFactory | undefined], SuiteCollector> → const describe: SuiteAPI
  • changed: const expect: Chai.ExpectStatic → const expect: Vi.ExpectStatic
  • changed: const it: TestCollector → const it: TestAPI
  • changed: const spies: Set<JestMockCompat<any[], any>> → const spies: Set<SpyInstance<any[], any>>
  • changed: const suite: ChainableFunction<'skip' | 'only' | 'todo' | 'concurrent', [name: string, factory?: TestFactory | undefined], SuiteCollector> → const suite: SuiteAPI
  • changed: const test: TestCollector → const test: TestAPI
  • changed: function fn<TArgs extends any[] = any[], R = any>(): JestMockCompatFn<TArgs, R> → function fn<TArgs extends any[] = any[], R = any>(): SpyInstanceFn<TArgs, R>
  • changed: function fn<TArgs extends any[] = any[], R = any>(implementation: (...args: TArgs) => R): JestMockCompatFn<TArgs, R> → function fn<TArgs extends any[] = any[], R = any>(implementation: (...args: TArgs) => R): SpyInstanceFn<TArgs, R>
  • changed: function spyOn<T, G extends Properties<Required<T>>>(obj: T, methodName: G, accesType: 'set'): JestMockCompat<[T[G]], void> → function spyOn<T, G extends Properties<Required<T>>>(obj: T, methodName: G, accesType: 'set'): SpyInstance<[T[G]], void>
  • changed: function spyOn<T, M extends Classes<Required<T>>>(object: T, method: M): Required<T>[M] extends new (...args: infer A) => infer R ? JestMockCompat<A, R> : never → function spyOn<T, M extends (Methods<Required<T>> | Classes<Required<T>>)>(obj: T, methodName: M): Required<T>[M] extends (...args: infer A) => infer R | (new (...args: infer A) => infer R) ? SpyInstance<A, R> : never
  • changed: function spyOn<T, M extends Methods<Required<T>>>(obj: T, methodName: M, mock?: T[M]): Required<T>[M] extends (...args: infer A) => infer R ? JestMockCompat<A, R> : never → function spyOn<T, S extends Properties<Required<T>>>(obj: T, methodName: S, accesType: 'get'): SpyInstance<[], T[S]>
  • changed: interface MockWithArgs<T extends Procedure> extends JestMockCompatFn<Parameters<T>, ReturnType<T>> → interface MockWithArgs<T extends Procedure> extends SpyInstanceFn<Parameters<T>, ReturnType<T>>
  • changed: property SuiteCollector.test: TestCollector → property SuiteCollector.test: TestAPI
  • changed: type EnhancedSpy<TArgs extends any[] = any[], TReturns = any> = JestMockCompat<TArgs, TReturns> & SpyImpl<TArgs, TReturns> → type EnhancedSpy<TArgs extends any[] = any[], TReturns = any> = SpyInstance<TArgs, TReturns> & SpyImpl<TArgs, TReturns>
  • changed: type MaybeMockedConstructor<T> = T extends new (...args: Array<any>) => infer R ? JestMockCompatFn<ConstructorParameters<T>, R> : T → type MaybeMockedConstructor<T> = T extends new (...args: Array<any>) => infer R ? SpyInstanceFn<ConstructorParameters<T>, R> : T
  • added: call SpyInstanceFn(...args: TArgs): TReturns
  • added: interface C8Options
  • added: interface ResolvedC8Options extends Required<C8Options>
  • added: interface SpyInstance<TArgs extends any[] = any[], TReturns = any>
  • added: interface SpyInstanceFn<TArgs extends any[] = any, TReturns = any> extends SpyInstance<TArgs, TReturns>
  • added: method SpyInstance.getMockImplementation(): ((...args: TArgs) => TReturns) | undefined
  • added: method SpyInstance.getMockName(): string
  • added: method SpyInstance.mockClear(): this
  • added: method SpyInstance.mockImplementation(fn: ((...args: TArgs) => TReturns) | (() => Promise<TReturns>)): this
  • added: method SpyInstance.mockImplementationOnce(fn: ((...args: TArgs) => TReturns) | (() => Promise<TReturns>)): this
  • added: method SpyInstance.mockName(n: string): this
  • added: method SpyInstance.mockRejectedValue(obj: any): this
  • added: method SpyInstance.mockRejectedValueOnce(obj: any): this
  • added: method SpyInstance.mockReset(): this
  • added: method SpyInstance.mockResolvedValue(obj: Awaited<TReturns>): this
  • added: method SpyInstance.mockResolvedValueOnce(obj: Awaited<TReturns>): this
  • added: method SpyInstance.mockRestore(): void
  • added: method SpyInstance.mockReturnThis(): this
  • added: method SpyInstance.mockReturnValue(obj: TReturns): this
  • added: method SpyInstance.mockReturnValueOnce(obj: TReturns): this
  • added: property C8Options.all?: boolean
  • added: property C8Options.allowExternal?: any
  • added: property C8Options.clean?: boolean
  • added: property C8Options.cleanOnRerun?: boolean
  • added: property C8Options.enabled?: boolean
  • added: property C8Options.exclude?: string[]
  • added: property C8Options.excludeNodeModules?: boolean
  • added: property C8Options.extension?: string | string[]
  • added: property C8Options.include?: string[]
  • added: property C8Options.reporter?: Arrayable<CoverageReporter>
  • added: property C8Options.reportsDirectory?: string
  • added: property C8Options.skipFull?: boolean
  • added: property InlineConfig.open?: boolean
  • added: property ResolvedC8Options.tempDirectory: string
  • added: property SpyInstance.mock: JestMockCompatContext<TArgs, TReturns>
  • added: property UserConfig.allowOnly?: boolean
  • added: type CoverageReporter = 'clover' | 'cobertura' | 'html-spa' | 'html' | 'json-summary' | 'json' | 'lcov' | 'lcovonly' | 'none' | 'teamcity' | 'text-lcov' | 'text-summary' | 'text'
  • added: type EachFunction = <T>(cases: T[]) => (name: string, fn: (...args: T extends any[] ? T : [T]) => void) => void
  • added: type SuiteAPI = ChainableFunction<'concurrent' | 'only' | 'skip' | 'todo', [name: string, factory?: SuiteFactory], SuiteCollector> & { each: EachFunction }
  • added: type SuiteFactory = (test: (name: string, fn: TestFunction) => void) => Awaitable<void>
  • added: type TestAPI = ChainableFunction<'concurrent' | 'only' | 'skip' | 'todo' | 'fails', [name: string, fn?: TestFunction, timeout?: number], void> & { each: EachFunction }
  • removed: property Vitest.visitedFilesMap: Map<string, RawSourceMap>
  • changed: function VitestPlugin(options?: UserConfig, viteOverrides?: UserConfig$1, ctx?: Vitest): Promise<Plugin$1[]> → function VitestPlugin(options?: UserConfig, ctx?: Vitest): Promise<Plugin$1[]>