rsnext/test/jest.d.ts
Zack Tanner 0d2c5520ed
refactor smooth scroll bailout logic in app navigations (#53186)
This refactors the changes from my previous PR to allow smooth scrolling for the appDir case -- `componentDidUpdate` isn't a reliable way to check if only the hash has changed. This adds a property to `focusAndScrollRef` and compares canonicalUrls (sans hash fragment)

- Original https://github.com/vercel/next.js/pull/52915

Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
2023-07-27 14:39:51 +00:00

23 lines
832 B
TypeScript

/// <reference types="jest" />
/// <reference types="jest-extended" />
declare namespace jest {
// https://github.com/jestjs/jest/blob/6460335f88cee3dcb9d29c49d55ab02b9d83f994/packages/expect/src/types.ts#L58-L72
interface MatcherState {
assertionCalls: number
error?: Error
expectedAssertionsNumber: number | null
expectedAssertionsNumberError?: Error
isExpectingAssertionsError?: Error
isNot?: boolean
numPassingAsserts: number
promise?: string
suppressedErrors: Array<Error>
}
interface Expect {
// https://github.com/jestjs/jest/blob/6460335f88cee3dcb9d29c49d55ab02b9d83f994/packages/expect/src/index.ts#L461
// https://github.com/jestjs/jest/blob/6460335f88cee3dcb9d29c49d55ab02b9d83f994/packages/expect/src/jestMatchersObject.ts#L44-L45
getState(): MatcherState
}
}