Skip to content

Upgrading @types/jest 23 to 24

Unknown23.3.14 → 24.9.1

Fetching 28 releases from GitHub…0 / 28
UnknownUpgrade verdict

DepDelta is still reading the notes for this range, 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.

Adds jest-diff ^24.3.0.

Installs 19 packages in all (was 0).

Also installs @jest/types, @types/istanbul-lib-coverage, @types/istanbul-lib-report, @types/istanbul-reports, @types/yargs, @types/yargs-parser, ansi-regex, ansi-styles, chalk, color-convert, color-name, diff-sequences, escape-string-regexp, has-flag, jest-get-type and 3 more.

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

  • removed: interface jest.MockResult
  • removed: property jest.Matchers.not: Matchers<R>
  • removed: property jest.Matchers.rejects: Matchers<Promise<R>>
  • removed: property jest.Matchers.resolves: Matchers<Promise<R>>
  • removed: property jest.MockResult.isThrow: boolean
  • removed: property jest.MockResult.value: any
  • removed: type ArgsType<T> = T extends (...args: infer A) => any ? A : never
  • changed: call jest.Each(cases: any[]): (name: string, fn: (...args: any[]) => any) => void → call jest.Each(cases: ReadonlyArray<ReadonlyArray<any>>): (name: string, fn: (...args: any[]) => any, timeout?: number) => void
  • changed: call jest.Each(strings: TemplateStringsArray, ...placeholders: any[]): (name: string, fn: (arg: any) => any) => void → call jest.Each(strings: TemplateStringsArray, ...placeholders: any[]): (name: string, fn: (arg: any) => any, timeout?: number) => void
  • changed: call jest.Expect<T = any>(actual: T): Matchers<T> → call jest.Expect<T = any>(actual: T): JestMatchers<T>
  • changed: function jest.doMock(moduleName: string, factory?: any, options?: MockOptions): typeof jest → function jest.doMock(moduleName: string, factory?: () => unknown, options?: MockOptions): typeof jest
  • changed: function jest.fn<T, Y extends any[]>(implementation: (...args: Y) => T): Mock<T, Y> → function jest.fn<T, Y extends any[]>(implementation?: (...args: Y) => T): Mock<T, Y>
  • changed: function jest.mock(moduleName: string, factory?: any, options?: MockOptions): typeof jest → function jest.mock(moduleName: string, factory?: () => unknown, options?: MockOptions): typeof jest
  • changed: function jest.spyOn<T extends {}, M extends keyof T>(object: T, method: M): T[M] extends (...args: any[]) => any ? SpyInstance<ReturnType<T[M]>, ArgsType<T[M]>> : never → function jest.spyOn<T extends {}, M extends FunctionPropertyNames<Required<T>>>(object: T, method: M): Required<T>[M] extends (...args: any[]) => any ? SpyInstance<ReturnType<Required<T>[M]>, ArgsType<Required<T>[M]>> : never
  • changed: function jest.spyOn<T extends {}, M extends keyof T>(object: T, method: M, accessType: 'get'): SpyInstance<T[M], []> → function jest.spyOn<T extends {}, M extends NonFunctionPropertyNames<Required<T>>>(object: T, method: M, accessType: 'get'): SpyInstance<Required<T>[M], []>
  • changed: function jest.spyOn<T extends {}, M extends keyof T>(object: T, method: M, accessType: 'set'): SpyInstance<void, [T[M]]> → function jest.spyOn<T extends {}, M extends NonFunctionPropertyNames<Required<T>>>(object: T, method: M, accessType: 'set'): SpyInstance<void, [Required<T>[M]]>
  • changed: interface jest.Matchers<R> → interface jest.Matchers<R, T = {}>
  • changed: method jest.Expect.arrayContaining(arr: any[]): any → method jest.Expect.arrayContaining<E = any>(arr: E[]): any
  • changed: method jest.Expect.objectContaining(obj: {}): any → method jest.Expect.objectContaining<E = {}>(obj: E): any
  • changed: method jest.InverseAsymmetricMatchers.arrayContaining(arr: any[]): any → method jest.InverseAsymmetricMatchers.arrayContaining<E = any>(arr: E[]): any
  • changed: method jest.InverseAsymmetricMatchers.objectContaining(obj: {}): any → method jest.InverseAsymmetricMatchers.objectContaining<E = {}>(obj: E): any
  • changed: method jest.MatcherUtils.equals(a: any, b: any): boolean → method jest.MatcherUtils.equals(a: any, b: any, customTesters?: EqualityTester[], strictCheck?: boolean): boolean
  • changed: method jest.Matchers.lastCalledWith(...args: any[]): R → method jest.Matchers.lastCalledWith<E extends any[]>(...args: E): R
  • changed: method jest.Matchers.lastReturnedWith(value: any): R → method jest.Matchers.lastReturnedWith<E = any>(value: E): R
  • changed: method jest.Matchers.nthCalledWith(nthCall: number, ...params: any[]): R → method jest.Matchers.nthCalledWith<E extends any[]>(nthCall: number, ...params: E): R
  • changed: method jest.Matchers.nthReturnedWith(n: number, value: any): R → method jest.Matchers.nthReturnedWith<E = any>(n: number, value: E): R
  • changed: method jest.Matchers.toBe(expected: any): R → method jest.Matchers.toBe<E = any>(expected: E): R
  • changed: method jest.Matchers.toBeCalledWith(...args: any[]): R → method jest.Matchers.toBeCalledWith<E extends any[]>(...args: E): R
  • changed: method jest.Matchers.toBeInstanceOf(expected: any): R → method jest.Matchers.toBeInstanceOf<E = any>(expected: E): R
  • changed: method jest.Matchers.toContain(expected: any): R → method jest.Matchers.toContain<E = any>(expected: E): R
  • changed: method jest.Matchers.toContainEqual(expected: any): R → method jest.Matchers.toContainEqual<E = any>(expected: E): R
  • changed: method jest.Matchers.toEqual(expected: any): R → method jest.Matchers.toEqual<E = any>(expected: E): R
  • changed: method jest.Matchers.toHaveBeenCalledWith(...params: any[]): R → method jest.Matchers.toHaveBeenCalledWith<E extends any[]>(...params: E): R
  • changed: method jest.Matchers.toHaveBeenLastCalledWith(...params: any[]): R → method jest.Matchers.toHaveBeenLastCalledWith<E extends any[]>(...params: E): R
  • changed: method jest.Matchers.toHaveBeenNthCalledWith(nthCall: number, ...params: any[]): R → method jest.Matchers.toHaveBeenNthCalledWith<E extends any[]>(nthCall: number, ...params: E): R
  • changed: method jest.Matchers.toHaveLastReturnedWith(expected: any): R → method jest.Matchers.toHaveLastReturnedWith<E = any>(expected: E): R
  • changed: method jest.Matchers.toHaveNthReturnedWith(nthCall: number, expected: any): R → method jest.Matchers.toHaveNthReturnedWith<E = any>(nthCall: number, expected: E): R
  • changed: method jest.Matchers.toHaveProperty(propertyPath: string | any[], value?: any): R → method jest.Matchers.toHaveProperty<E = any>(propertyPath: string | any[], value?: E): R
  • changed: method jest.Matchers.toHaveReturnedWith(expected: any): R → method jest.Matchers.toHaveReturnedWith<E = any>(expected: E): R
  • changed: method jest.Matchers.toMatchInlineSnapshot<T extends { [P in keyof R]: any }>(propertyMatchers: Partial<T>, snapshot?: string): R → method jest.Matchers.toMatchInlineSnapshot<U extends { [P in keyof T]: any }>(propertyMatchers: Partial<U>, snapshot?: string): R
  • changed: method jest.Matchers.toMatchObject(expected: {} | any[]): R → method jest.Matchers.toMatchObject<E extends {} | any[]>(expected: E): R
  • changed: method jest.Matchers.toMatchSnapshot<T extends { [P in keyof R]: any }>(propertyMatchers: Partial<T>, snapshotName?: string): R → method jest.Matchers.toMatchSnapshot<U extends { [P in keyof T]: any }>(propertyMatchers: Partial<U>, snapshotName?: string): R
  • changed: method jest.Matchers.toReturnWith(value: any): R → method jest.Matchers.toReturnWith<E = any>(value: E): R
  • changed: method jest.Matchers.toStrictEqual(expected: {}): R → method jest.Matchers.toStrictEqual<E = any>(expected: E): R
  • changed: method jest.MockInstance.mockImplementation(fn?: (...args: Y) => T): Mock<T, Y> → method jest.MockInstance.mockImplementation(fn?: (...args: Y) => T): this
  • changed: method jest.MockInstance.mockImplementationOnce(fn: (...args: Y) => T): Mock<T, Y> → method jest.MockInstance.mockImplementationOnce(fn: (...args: Y) => T): this
  • changed: method jest.MockInstance.mockName(name: string): Mock<T, Y> → method jest.MockInstance.mockName(name: string): this
  • changed: method jest.MockInstance.mockRejectedValue(value: any): Mock<Promise<T>, Y> → method jest.MockInstance.mockRejectedValue(value: RejectedValue<T>): this
  • changed: method jest.MockInstance.mockRejectedValueOnce(value: any): Mock<Promise<T>, Y> → method jest.MockInstance.mockRejectedValueOnce(value: RejectedValue<T>): this
  • changed: method jest.MockInstance.mockResolvedValue(value: T | PromiseLike<T>): Mock<Promise<T>, Y> → method jest.MockInstance.mockResolvedValue(value: ResolvedValue<T>): this
  • changed: method jest.MockInstance.mockResolvedValueOnce(value: T | PromiseLike<T>): Mock<Promise<T>, Y> → method jest.MockInstance.mockResolvedValueOnce(value: ResolvedValue<T>): this
  • changed: method jest.MockInstance.mockReturnThis(): Mock<T, Y> → method jest.MockInstance.mockReturnThis(): this
  • changed: method jest.MockInstance.mockReturnValue(value: T): Mock<T, Y> → method jest.MockInstance.mockReturnValue(value: T): this
  • changed: method jest.MockInstance.mockReturnValueOnce(value: T): Mock<T, Y> → method jest.MockInstance.mockReturnValueOnce(value: T): this
  • changed: method jest.SnapshotSerializerPlugin.print(val: any, serialize: ((val: any) => string), indent: ((str: string) => string), opts: SnapshotSerializerOptions, colors: SnapshotSerializerColors): string → method jest.SnapshotSerializerPlugin.print(val: any, serialize: (val: any) => string, indent: (str: string) => string, opts: SnapshotSerializerOptions, colors: SnapshotSerializerColors): string
  • changed: property jest.CustomMatcherResult.message: string | (() => string) → property jest.CustomMatcherResult.message: () => string
  • changed: property jest.MatcherUtils.utils: { readonly EXPECTED_COLOR: (text: string) => string; readonly RECEIVED_COLOR: (text: string) => string; ensureActualIsNumber(actual: any, matcherName?: string): void; ensureExpectedIsNumber(actual: any, matcherName?: string): void; ensureNoExpected(actual: any, matcherName?: string): void; ensureNumbers(actual: any, expected: any, matcherName?: string): void; get… → property jest.MatcherUtils.utils: { readonly EXPECTED_COLOR: MatcherColorFn; readonly RECEIVED_COLOR: MatcherColorFn; readonly INVERTED_COLOR: MatcherColorFn; readonly BOLD_WEIGHT: MatcherColorFn; readonly DIM_COLOR: MatcherColorFn; readonly SUGGEST_TO_CONTAIN_EQUAL: string; diff(a: any, b: any, options?: import('jest-diff').DiffOptions): string | null; ensureActualIsNumber(actual: any, matcherNa…
  • changed: property jest.MockContext.results: MockResult[] → property jest.MockContext.results: Array<MockResult<T>>
  • changed: property jest.TestResult.perfStats: { end: Milliseconds, start: Milliseconds } → property jest.TestResult.perfStats: { end: Milliseconds; start: Milliseconds }
  • changed: property jest.TestResult.snapshot: { added: number, fileDeleted: boolean, matched: number, unchecked: number, unmatched: number, updated: number } → property jest.TestResult.snapshot: { added: number; fileDeleted: boolean; matched: number; unchecked: number; unmatched: number; updated: number }
  • changed: type jest.CustomMatcher = (this: MatcherUtils, received: any, ...actual: any[]) => CustomMatcherResult | Promise<CustomMatcherResult> → type jest.CustomMatcher = (this: MatcherContext, received: any, ...actual: any[]) => CustomMatcherResult | Promise<CustomMatcherResult>
  • changed: type jest.Mocked<T> = { [P in keyof T]: T[P] & MockInstance<T[P], ArgsType<T[P]>> } & T → 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]…
  • added: call jest.ChalkFunction(...text: any[]): string
  • added: call jest.ChalkFunction(text: TemplateStringsArray, ...placeholders: any[]): string
  • added: call jest.Each<T extends ReadonlyArray<any>>(cases: ReadonlyArray<T>): (name: string, fn: (...args: ExtractEachCallbackArgs<T>) => any, timeout?: number) => void
  • added: call jest.Each<T extends any[] | [any]>(cases: ReadonlyArray<T>): (name: string, fn: (...args: T) => any, timeout?: number) => void
  • added: call jest.Each<T>(cases: ReadonlyArray<T>): (name: string, fn: (...args: T[]) => any, timeout?: number) => void
  • added: function jest.advanceTimersToNextTimer(step?: number): void
  • added: function jest.getTimerCount(): number
  • added: function jest.isolateModules(fn: () => void): typeof jest
  • added: function jest.retryTimes(numRetries: number): typeof jest
  • added: index jest.MatcherUtils[other: string]: any
  • added: interface jest.AsymmetricMatcher
  • added: interface jest.ChalkColorSupport
  • added: interface jest.ChalkFunction
  • added: interface jest.MatcherHintOptions
  • added: interface jest.MatcherState
  • added: interface jest.MockResultIncomplete
  • added: interface jest.MockResultReturn<T>
  • added: interface jest.MockResultThrow
  • added: method jest.AsymmetricMatcher.asymmetricMatch(other: unknown): boolean
  • added: method jest.Expect.getState(): MatcherState & Record<string, any>
  • added: method jest.Expect.setState(state: object): void
  • added: method jest.FakeTimers.advanceTimersToNextTimer(steps?: number): void
  • added: method jest.FakeTimers.getTimerCount(): number
  • added: property jest.AggregatedResult.numTodoTests: number
  • added: property jest.ChalkColorSupport.has16m: boolean
  • added: property jest.ChalkColorSupport.has256: boolean
  • added: property jest.ChalkColorSupport.hasBasic: boolean
  • added: property jest.ChalkColorSupport.level: 0 | 1 | 2 | 3
  • added: property jest.InitialOptions.setupFilesAfterEnv?: Path[]
  • added: property jest.It.todo: It
  • added: property jest.MatcherHintOptions.comment?: string
  • added: property jest.MatcherHintOptions.expectedColor?: MatcherHintColor
  • added: property jest.MatcherHintOptions.isDirectExpectCall?: boolean
  • added: property jest.MatcherHintOptions.isNot?: boolean
  • added: property jest.MatcherHintOptions.promise?: string
  • added: property jest.MatcherHintOptions.receivedColor?: MatcherHintColor
  • added: property jest.MatcherHintOptions.secondArgument?: string
  • added: property jest.MatcherHintOptions.secondArgumentColor?: MatcherHintColor
  • added: property jest.MatcherState.assertionCalls: number
  • added: property jest.MatcherState.currentTestName: string
  • added: property jest.MatcherState.expand: boolean
  • added: property jest.MatcherState.expectedAssertionsNumber: number
  • added: property jest.MatcherState.isExpectingAssertions?: boolean
  • added: property jest.MatcherState.suppressedErrors: Error[]
  • added: property jest.MatcherState.testPath: string
  • added: property jest.MockResultIncomplete.type: 'incomplete'
  • added: property jest.MockResultIncomplete.value: undefined
  • added: property jest.MockResultReturn.type: 'return'
  • added: property jest.MockResultReturn.value: T
  • added: property jest.MockResultThrow.type: 'throw'
  • added: property jest.MockResultThrow.value: any
  • added: readonly property jest.MatcherUtils.assertionCalls: number
  • added: readonly property jest.MatcherUtils.currentTestName: string
  • added: readonly property jest.MatcherUtils.dontThrow: () => void
  • added: readonly property jest.MatcherUtils.expectedAssertionsNumber: number | null
  • added: readonly property jest.MatcherUtils.isExpectingAssertions: boolean
  • added: readonly property jest.MatcherUtils.promise: string
  • added: readonly property jest.MatcherUtils.suppressedErrors: any[]
  • added: readonly property jest.MatcherUtils.testPath: string
  • added: 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…
  • added: type jest.AndNot<T> = T & { not: T }
  • added: type jest.ArgsType<T> = T extends (...args: infer A) => any ? A : never
  • added: type jest.CustomAsymmetricMatcher<TMatcher extends (...args: any[]) => any> = (...args: RemoveFirstFromTuple<Parameters<TMatcher>>) => AsymmetricMatcher
  • added: type jest.CustomAsyncMatchers<TMatchers extends ExpectExtendMap> = { [K in NonAsyncMatchers<TMatchers>]: CustomAsymmetricMatcher<TMatchers[K]> }
  • added: type jest.CustomJestMatcher<TMatcher extends (...args: any[]) => any, TMatcherReturn> = (...args: RemoveFirstFromTuple<Parameters<TMatcher>>) => TMatcherReturn
  • added: type jest.EqualityTester = (a: any, b: any) => boolean | undefined
  • added: type jest.ExpectProperties = { [K in keyof Expect]: Expect[K] }
  • added: type jest.ExtendedExpect<TMatchers extends ExpectExtendMap> = ExpectProperties & AndNot<CustomAsyncMatchers<TMatchers>> & ExtendedExpectFunction<TMatchers>
  • added: type jest.ExtendedExpectFunction<TMatchers extends ExpectExtendMap> = <TActual>(actual: TActual) => JestExtendedMatchers<TMatchers, TActual>
  • added: type jest.ExtendedMatchers<TMatchers extends ExpectExtendMap, TMatcherReturn, TActual> = Matchers<TMatcherReturn, TActual> & { [K in keyof TMatchers]: CustomJestMatcher<TMatchers[K], TMatcherReturn> }
  • added: type jest.FunctionPropertyNames<T> = { [K in keyof T]: T[K] extends (...args: any[]) => any ? K : never }[keyof T] & string
  • added: type jest.JestExtendedMatchers<TMatchers extends ExpectExtendMap, TActual> = JestMatchersShape<ExtendedMatchers<TMatchers, void, TActual>, ExtendedMatchers<TMatchers, Promise<void>, TActual>>
  • added: type jest.JestMatchers<T> = JestMatchersShape<Matchers<void, T>, Matchers<Promise<void>, T>>
  • added: type jest.JestMatchersShape<TNonPromise extends {} = {}, TPromise extends {} = {}> = { resolves: AndNot<TPromise>, rejects: AndNot<TPromise> } & AndNot<TNonPromise>
  • added: type jest.MatcherColorFn = ChalkFunction & { supportsColor: ChalkColorSupport }
  • added: type jest.MatcherContext = MatcherUtils & Readonly<MatcherState>
  • added: type jest.MatcherHintColor = (arg: string) => string
  • added: type jest.MockResult<T> = MockResultReturn<T> | MockResultThrow | MockResultIncomplete
  • added: 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…
  • added: type jest.MockedFunction<T extends (...args: any[]) => any> = MockInstance<ReturnType<T>, ArgsType<T>> & T
  • added: type jest.NonAsyncMatchers<TMatchers extends ExpectExtendMap> = { [K in keyof TMatchers]: ReturnType<TMatchers[K]> extends Promise<CustomMatcherResult>? never: K }[keyof TMatchers]
  • added: type jest.NonFunctionPropertyNames<T> = { [K in keyof T]: T[K] extends (...args: any[]) => any ? never : K }[keyof T] & string
  • added: type jest.NonPromiseMatchers<T extends JestMatchersShape> = Omit<T, 'resolves' | 'rejects' | 'not'>
  • added: type jest.Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>
  • added: type jest.Parameters<T extends (...args: any[]) => any> = T extends (...args: infer P) => any ? P : never
  • added: type jest.PrintLabel = (string: string) => string
  • added: type jest.PromiseMatchers<T extends JestMatchersShape> = Omit<T['resolves'], 'not'>
  • added: type jest.RejectedValue<T> = T extends PromiseLike<any> ? any : never
  • added: type jest.RemoveFirstFromTuple<T extends any[]> = T['length'] extends 0 ? [] : (((...b: T) => void) extends (a: any, ...b: infer I) => void ? I : [])
  • added: type jest.ResolvedValue<T> = T extends PromiseLike<infer U> ? U | T : never