Skip to content

Upgrading @types/jest 28 to 29

Unknown28.1.8 → 29.5.14

Fetching 34 releases from GitHub…8 / 34
UnknownUpgrade verdict

DepDelta is still reading the notes for 26 of 34 releases, so breaking changes can't be ruled out yet.

  • DepDelta is still reading the release notes in this range, so it can't rule out breaking changes yet.
  • This page updates as the notes come in.
Still reading release notes

DepDelta is still reading the release notes in this range. This updates as they come in.

Installs 43 packages in all (was 44).

No longer installs ansi-regex.

Moves @jest/expect-utils 28.1.3 → 29.7.0, @jest/schemas 28.1.3 → 29.6.3, @jest/types 28.1.3 → 29.6.3, @sinclair/typebox 0.24.52 → 0.27.12, diff-sequences 28.1.1 → 29.6.3, expect 28.1.3 → 29.7.0, jest-diff 28.1.3 → 29.7.0, jest-get-type 28.0.2 → 29.6.3, jest-matcher-utils 28.1.3 → 29.7.0, jest-message-util 28.1.3 → 29.7.0, jest-util 28.1.3 → 29.7.0, pretty-format 28.1.3 → 29.7.0. Your build may pick other versions.

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

  • changed: call jest.Each(cases: ReadonlyArray<ReadonlyArray<any>>): (name: string, fn: (...args: any[]) => any, timeout?: number) => void → call jest.Each(cases: ReadonlyArray<readonly any[]>): (name: string, fn: (...args: any[]) => any, timeout?: number) => void
  • changed: call jest.Each(strings: TemplateStringsArray, ...placeholders: any[]): (name: string, fn: (arg: any) => any, timeout?: number) => void → call jest.Each(strings: TemplateStringsArray, ...placeholders: any[]): (name: string, fn: (arg: any, done: DoneCallback) => any, timeout?: number) => void
  • changed: call jest.Each<T extends ReadonlyArray<any>>(cases: ReadonlyArray<T>): (name: string, fn: (...args: ExtractEachCallbackArgs<T>) => any, timeout?: number) => void → call jest.Each<T extends any[] | [any]>(cases: readonly T[]): (name: string, fn: (...args: T) => any, timeout?: number) => void
  • changed: call jest.Each<T extends any[] | [any]>(cases: ReadonlyArray<T>): (name: string, fn: (...args: T) => any, timeout?: number) => void → call jest.Each<T extends readonly any[]>(cases: readonly T[]): (name: string, fn: (...args: ExtractEachCallbackArgs<T>) => any, timeout?: number) => void
  • changed: call jest.Each<T>(cases: ReadonlyArray<T>): (name: string, fn: (...args: T[]) => any, timeout?: number) => void → call jest.Each<T>(cases: readonly T[]): (name: string, fn: (arg: T, done: DoneCallback) => any, timeout?: number) => void
  • changed: call jest.Mock(...args: Y): T → call jest.Mock(this: C, ...args: Y): T
  • changed: function jasmine.arrayContaining(sample: any[]): ArrayContaining → function jasmine.arrayContaining(sample: readonly any[]): ArrayContaining
  • changed: function jest.advanceTimersByTime(msToRun: number): typeof jest → function jest.advanceTimersByTime(msToRun: number): void
  • changed: function jest.clearAllTimers(): typeof jest → function jest.clearAllTimers(): void
  • changed: function jest.fn<T, Y extends any[]>(implementation?: (...args: Y) => T): Mock<T, Y> → function jest.fn<T, Y extends any[], C = any>(implementation?: (this: C, ...args: Y) => T): Mock<T, Y, C>
  • changed: function jest.mocked<T>(item: T, deep: true): MaybeMockedDeep<T> → function jest.mocked<T>(source: T, options: { shallow: true }): MaybeMocked<T>
  • changed: function jest.mocked<T>(item: T, deep?: false): MaybeMocked<T> → function jest.mocked<T>(source: T, options?: { shallow: false }): MaybeMockedDeep<T>
  • changed: function jest.runAllImmediates(): typeof jest → function jest.runAllImmediates(): void
  • changed: function jest.runAllTicks(): typeof jest → function jest.runAllTicks(): void
  • changed: function jest.runAllTimers(): typeof jest → function jest.runAllTimers(): void
  • changed: function jest.runOnlyPendingTimers(): typeof jest → function jest.runOnlyPendingTimers(): void
  • changed: function jest.spyOn<T extends {}, M extends ConstructorPropertyNames<Required<T>>>(object: T, method: M): Required<T>[M] extends new (...args: any[]) => any ? SpyInstance<InstanceType<Required<T>[M]>, ConstructorArgsType<Required<T>[M]>> : never → function jest.spyOn<T extends {}, M extends ConstructorPropertyNames<Required<T>>>(object: T, method: M): ConstructorProperties<Required<T>>[M] extends new(...args: any[]) => any ? SpyInstance<InstanceType<ConstructorProperties<Required<T>>[M]>, ConstructorArgsType<ConstructorProperties<Required<T>>[M]>> : never
  • changed: function jest.useFakeTimers(config?: FakeTimersConfig): typeof jest → function jest.useFakeTimers(config?: FakeTimersConfig | LegacyFakeTimersConfig): typeof jest
  • changed: interface jest.Mock<T = any, Y extends any[] = any> extends Function, MockInstance<T, Y> → interface jest.Mock<T = any, Y extends any[] = any, C = any> extends Function, MockInstance<T, Y, C>
  • changed: interface jest.MockContext<T, Y extends any[]> → interface jest.MockContext<T, Y extends any[], C = any>
  • changed: interface jest.MockInstance<T, Y extends any[]> → interface jest.MockInstance<T, Y extends any[], C = any>
  • changed: interface jest.MockWithArgs<T extends MockableFunction> extends MockInstance<ReturnType<T>, ArgumentsOf<T>> → interface jest.MockWithArgs<T extends MockableFunction> extends MockInstance<ReturnType<T>, ArgumentsOf<T>, ConstructorReturnType<T>>
  • changed: interface jest.SpyInstance<T = any, Y extends any[] = any> extends MockInstance<T, Y> → interface jest.SpyInstance<T = any, Y extends any[] = any, C = any> extends MockInstance<T, Y, C>
  • changed: method jest.Expect.arrayContaining<E = any>(arr: E[]): any → method jest.Expect.arrayContaining<E = any>(arr: readonly E[]): any
  • changed: method jest.InverseAsymmetricMatchers.arrayContaining<E = any>(arr: E[]): any → method jest.InverseAsymmetricMatchers.arrayContaining<E = any>(arr: readonly E[]): any
  • changed: method jest.Matchers.lastReturnedWith<E = any>(value: E): R → method jest.Matchers.lastReturnedWith<E = any>(expected?: E): R
  • changed: method jest.Matchers.nthReturnedWith<E = any>(n: number, value: E): R → method jest.Matchers.nthReturnedWith<E = any>(n: number, expected?: E): R
  • changed: method jest.Matchers.toHaveLastReturnedWith<E = any>(expected: E): R → method jest.Matchers.toHaveLastReturnedWith<E = any>(expected?: E): R
  • changed: method jest.Matchers.toHaveNthReturnedWith<E = any>(nthCall: number, expected: E): R → method jest.Matchers.toHaveNthReturnedWith<E = any>(nthCall: number, expected?: E): R
  • changed: method jest.Matchers.toHaveProperty<E = any>(propertyPath: string | any[], value?: E): R → method jest.Matchers.toHaveProperty<E = any>(propertyPath: string | readonly any[], value?: E): R
  • changed: method jest.Matchers.toHaveReturnedWith<E = any>(expected: E): R → method jest.Matchers.toHaveReturnedWith<E = any>(expected?: E): R
  • changed: method jest.Matchers.toReturnWith<E = any>(value: E): R → method jest.Matchers.toReturnWith<E = any>(value?: E): R
  • changed: new jasmine.ArrayContaining(sample: any[]): any → new jasmine.ArrayContaining(sample: readonly any[]): any
  • changed: property FakeTimersConfig.legacyFakeTimers?: boolean → property FakeTimersConfig.legacyFakeTimers?: false
  • changed: property jest.It.todo: It → property jest.It.todo: (name: string) => void
  • changed: property jest.MockContext.lastCall: Y → property jest.MockContext.lastCall?: Y
  • changed: property jest.MockInstance.mock: MockContext<T, Y> → property jest.MockInstance.mock: MockContext<T, Y, C>
  • changed: property jest.MockOptions.virtual?: boolean | undefined → property jest.MockOptions.virtual?: boolean
  • changed: type ExtractEachCallbackArgs<T extends ReadonlyArray<any>> = { 1: [T[0]]; 2: [T[0], T[1]]; 3: [T[0], T[1], T[2]]; 4: [T[0], T[1], T[2], T[3]]; 5: [T[0], T[1], T[2], T[3], T[4]]; 6: [T[0], T[1], T[2], T[3], T[4], T[5]]; 7… → type ExtractEachCallbackArgs<T extends readonly any[]> = { 1: [T[0]]; 2: [T[0], T[1]]; 3: [T[0], T[1], T[2]]; 4: [T[0], T[1], T[2], T[3]]; 5: [T[0], T[1], T[2], T[3], T[4]]; 6: [T[0], T[1], T[2], T[3], T[4], T[5]]; 7…
  • changed: type jest.Constructor = new (...args: any[]) => any → type jest.Constructor = new(...args: any[]) => any
  • changed: type jest.ConstructorArgsType<T> = T extends new (...args: infer A) => any ? A : never → type jest.ConstructorArgsType<T> = T extends new(...args: infer A) => any ? A : never
  • changed: type jest.ConstructorArgumentsOf<T> = T extends new (...args: infer A) => any ? A : never → type jest.ConstructorArgumentsOf<T> = T extends new(...args: infer A) => any ? A : never
  • changed: type jest.ConstructorPropertyNames<T> = { [K in keyof T]: T[K] extends Constructor ? K : never }[keyof T] & string → type jest.ConstructorPropertyNames<T> = RemoveIndex<keyof ConstructorProperties<T>>
  • changed: type jest.MatcherState = Pick<import('expect').MatcherState, | 'assertionCalls' | 'currentTestName' | 'expand' | 'expectedAssertionsNumber' | 'isExpectingAssertions' | 'suppressedError… → type jest.MatcherState = import('expect').MatcherState
  • changed: type jest.MatcherUtils = Pick<import('expect').MatcherState, | 'isNot' | 'dontThrow' | 'promise' | 'assertionCalls' | 'expectedAssertionsNumber' | 'isExpectingAssertions' | 'suppressed… → type jest.MatcherUtils = import('expect').MatcherUtils & { [other: string]: any }
  • changed: type jest.MaybeMockedConstructor<T> = T extends new (...args: any[]) => infer R ? MockInstance<R, ConstructorArgumentsOf<T>> : T → type jest.MaybeMockedConstructor<T> = T extends new(...args: any[]) => infer R ? MockInstance<R, ConstructorArgumentsOf<T>, R> : T
  • changed: type jest.Mocked<T> = { [P in keyof T]: T[P] extends (...args: any[]) => any ? MockInstance<ReturnType<T[P]>, ArgsType<T[P]>> : T[P] extends Constructable ? MockedClass<T[P]> : T[P]… → type jest.Mocked<T> = { [P in keyof T]: T[P] extends (this: infer C, ...args: any[]) => any ? MockInstance<ReturnType<T[P]>, ArgsType<T[P]>, C> : T[P] extends Constructable ? Mocked…
  • changed: type jest.MockedClass<T extends Constructable> = MockInstance<InstanceType<T>, T extends new (...args: infer P) => any ? P : never> & { prototype: T extends { prototype: any } ? Mocked<T['prototype']> : never… → type jest.MockedClass<T extends Constructable> = MockInstance<InstanceType<T>, T extends new(...args: infer P) => any ? P : never, T extends new(...args: any[]) => infer C ? C : never> & { prototype: T extend…
  • changed: type jest.MockedFunction<T extends (...args: any[]) => any> = MockInstance<ReturnType<T>, ArgsType<T>> & T → type jest.MockedFunction<T extends (...args: any[]) => any> = MockInstance<ReturnType<T>, ArgsType<T>, T extends (this: infer C, ...args: any[]) => any ? C : never> & T
  • changed: type jest.ProvidesCallback = ((cb: DoneCallback) => void | undefined) | (() => Promise<unknown>) → type jest.ProvidesCallback = ((cb: DoneCallback) => void | undefined) | (() => PromiseLike<unknown>)
  • changed: type jest.SpiedFunction<T extends (...args: any[]) => any> = SpyInstance<ReturnType<T>, ArgsType<T>> → type jest.SpiedFunction<T extends (...args: any) => any> = SpyInstance<ReturnType<T>, ArgsType<T>, T extends (this: infer C, ...args: any) => any ? C : never>
  • added: function jest.advanceTimersByTimeAsync(msToRun: number): Promise<void>
  • added: function jest.advanceTimersToNextTimerAsync(steps?: number): Promise<void>
  • added: function jest.getSeed(): number
  • added: function jest.isEnvironmentTornDown(): boolean
  • added: function jest.isolateModulesAsync(fn: () => Promise<void>): Promise<void>
  • added: function jest.now(): number
  • added: function jest.replaceProperty<T extends object, K extends keyof T>(obj: T, key: K, value: T[K]): ReplaceProperty<T[K]>
  • added: function jest.runAllTimersAsync(): Promise<void>
  • added: function jest.runOnlyPendingTimersAsync(): Promise<void>
  • added: interface LegacyFakeTimersConfig
  • added: interface jest.ReplaceProperty<K>
  • added: method jest.MockInstance.withImplementation(fn: (...args: Y) => T, callback: () => Promise<unknown>): Promise<void>
  • added: method jest.MockInstance.withImplementation(fn: (...args: Y) => T, callback: () => void): void
  • added: method jest.ReplaceProperty.replaceValue(value: K): this
  • added: method jest.ReplaceProperty.restore(): void
  • added: property LegacyFakeTimersConfig.legacyFakeTimers?: true
  • added: property jest.MockContext.contexts: C[]
  • added: type jest.ConstructorProperties<T> = { [K in keyof RemoveIndex<T> as RemoveIndex<T>[K] extends Constructor ? K : never]: RemoveIndex<T>[K] }
  • added: type jest.ConstructorReturnType<T> = T extends new(...args: any) => infer C ? C : any
  • added: type jest.RemoveIndex<T> = { [P in keyof T as string extends P ? never : number extends P ? never : P]: T[P] }
  • added: type jest.Spied<T extends (abstract new(...args: any) => any) | ((...args: any) => any)> = T extends abstract new(...args: any) => any ? SpiedClass<T> : T extends (...args: any) => any ? SpiedFunction<T> : never
  • added: type jest.SpiedClass<T extends abstract new(...args: any) => any> = SpyInstance<InstanceType<T>, ConstructorParameters<T>, T extends abstract new(...args: any) => infer C ? C : never>
  • added: type jest.SpiedGetter<T> = SpyInstance<T, []>
  • added: type jest.SpiedSetter<T> = SpyInstance<void, [T]>