v2 new release (#77)
This commit is contained in:
committed by
GitHub
parent
217bf70cbd
commit
199ab446df
0
node_modules/@types/jest/LICENSE
generated
vendored
Normal file → Executable file
0
node_modules/@types/jest/LICENSE
generated
vendored
Normal file → Executable file
6
node_modules/@types/jest/README.md
generated
vendored
Normal file → Executable file
6
node_modules/@types/jest/README.md
generated
vendored
Normal file → Executable file
@@ -8,10 +8,10 @@ This package contains type definitions for Jest (https://jestjs.io/).
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Mon, 18 May 2020 19:24:51 GMT
|
||||
* Dependencies: none
|
||||
* Last updated: Tue, 06 Jul 2021 21:33:43 GMT
|
||||
* Dependencies: [@types/jest-diff](https://npmjs.com/package/@types/jest-diff), [@types/pretty-format](https://npmjs.com/package/@types/pretty-format)
|
||||
* Global values: `afterAll`, `afterEach`, `beforeAll`, `beforeEach`, `describe`, `expect`, `fail`, `fdescribe`, `fit`, `it`, `jasmine`, `jest`, `pending`, `spyOn`, `test`, `xdescribe`, `xit`, `xtest`
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Asana (https://asana.com)
|
||||
// Ivo Stratev](https://github.com/NoHomey), [jwbay](https://github.com/jwbay), [Alexey Svetliakov](https://github.com/asvetliakov), [Alex Jover Morales](https://github.com/alexjoverm), [Allan Lukwago](https://github.com/epicallan), [Ika](https://github.com/ikatyang), [Waseem Dahman](https://github.com/wsmd), [Jamie Mason](https://github.com/JamieMason), [Douglas Duteil](https://github.com/douglasduteil), [Ahn](https://github.com/ahnpnl), [Josh Goldberg](https://github.com/joshuakgoldberg), [Jeff Lau](https://github.com/UselessPickles), [Andrew Makarov](https://github.com/r3nya), [Martin Hochel](https://github.com/hotell), [Sebastian Sebald](https://github.com/sebald), [Andy](https://github.com/andys8), [Antoine Brault](https://github.com/antoinebrault), [Jeroen Claassens](https://github.com/favna), [Gregor Stamać](https://github.com/gstamac), [ExE Boss](https://github.com/ExE-Boss), [Alex Bolenok](https://github.com/quassnoi), [Mario Beltrán Alarcón](https://github.com/Belco90), [Tony Hallett](https://github.com/tonyhallett), [Jason Yu](https://github.com/ycmjason), [Devansh Jethmalani](https://github.com/devanshj), [Pawel Fajfer](https://github.com/pawfa), and [Regev Brody](https://github.com/regevbr).
|
||||
// Ivo Stratev](https://github.com/NoHomey), [jwbay](https://github.com/jwbay), [Alexey Svetliakov](https://github.com/asvetliakov), [Alex Jover Morales](https://github.com/alexjoverm), [Allan Lukwago](https://github.com/epicallan), [Ika](https://github.com/ikatyang), [Waseem Dahman](https://github.com/wsmd), [Jamie Mason](https://github.com/JamieMason), [Douglas Duteil](https://github.com/douglasduteil), [Ahn](https://github.com/ahnpnl), [Josh Goldberg](https://github.com/joshuakgoldberg), [Jeff Lau](https://github.com/UselessPickles), [Andrew Makarov](https://github.com/r3nya), [Martin Hochel](https://github.com/hotell), [Sebastian Sebald](https://github.com/sebald), [Andy](https://github.com/andys8), [Antoine Brault](https://github.com/antoinebrault), [Gregor Stamać](https://github.com/gstamac), [ExE Boss](https://github.com/ExE-Boss), [Alex Bolenok](https://github.com/quassnoi), [Mario Beltrán Alarcón](https://github.com/Belco90), [Tony Hallett](https://github.com/tonyhallett), [Jason Yu](https://github.com/ycmjason), [Devansh Jethmalani](https://github.com/devanshj), [Pawel Fajfer](https://github.com/pawfa), [Regev Brody](https://github.com/regevbr), and [Alexandre Germain](https://github.com/gerkindev).
|
||||
|
167
node_modules/@types/jest/index.d.ts
generated
vendored
Normal file → Executable file
167
node_modules/@types/jest/index.d.ts
generated
vendored
Normal file → Executable file
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Jest 25.2
|
||||
// Type definitions for Jest 26.0
|
||||
// Project: https://jestjs.io/
|
||||
// Definitions by: Asana (https://asana.com)
|
||||
// Ivo Stratev <https://github.com/NoHomey>
|
||||
@@ -18,7 +18,6 @@
|
||||
// Sebastian Sebald <https://github.com/sebald>
|
||||
// Andy <https://github.com/andys8>
|
||||
// Antoine Brault <https://github.com/antoinebrault>
|
||||
// Jeroen Claassens <https://github.com/favna>
|
||||
// Gregor Stamać <https://github.com/gstamac>
|
||||
// ExE Boss <https://github.com/ExE-Boss>
|
||||
// Alex Bolenok <https://github.com/quassnoi>
|
||||
@@ -28,8 +27,9 @@
|
||||
// Devansh Jethmalani <https://github.com/devanshj>
|
||||
// Pawel Fajfer <https://github.com/pawfa>
|
||||
// Regev Brody <https://github.com/regevbr>
|
||||
// Alexandre Germain <https://github.com/gerkindev>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.1
|
||||
// Minimum TypeScript Version: 3.8
|
||||
|
||||
declare var beforeAll: jest.Lifecycle;
|
||||
declare var beforeEach: jest.Lifecycle;
|
||||
@@ -72,23 +72,6 @@ type ExtractEachCallbackArgs<T extends ReadonlyArray<any>> = {
|
||||
: 'fallback'
|
||||
];
|
||||
|
||||
interface NodeRequire {
|
||||
/**
|
||||
* Returns the actual module instead of a mock, bypassing all checks on
|
||||
* whether the module should receive a mock implementation or not.
|
||||
*
|
||||
* @deprecated Use `jest.requireActual` instead.
|
||||
*/
|
||||
requireActual(moduleName: string): any;
|
||||
/**
|
||||
* Returns a mock module instead of the actual module, bypassing all checks
|
||||
* on whether the module should be required normally or not.
|
||||
*
|
||||
* @deprecated Use `jest.requireMock`instead.
|
||||
*/
|
||||
requireMock(moduleName: string): any;
|
||||
}
|
||||
|
||||
declare namespace jest {
|
||||
/**
|
||||
* Provides a way to add Jasmine-compatible matchers into your Jest context.
|
||||
@@ -107,6 +90,11 @@ declare namespace jest {
|
||||
* Equivalent to calling .mockClear() on every mocked function.
|
||||
*/
|
||||
function clearAllMocks(): typeof jest;
|
||||
/**
|
||||
* Use the automatic mocking system to generate a mocked version of the given module.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
function createMockFromModule<T>(moduleName: string): T;
|
||||
/**
|
||||
* Resets the state of all mocks.
|
||||
* Equivalent to calling .mockReset() on every mocked function.
|
||||
@@ -130,6 +118,26 @@ declare namespace jest {
|
||||
* Returns the number of fake timers still left to run.
|
||||
*/
|
||||
function getTimerCount(): number;
|
||||
/**
|
||||
* Set the current system time used by fake timers. Simulates a user
|
||||
* changing the system clock while your program is running. It affects the
|
||||
* current time but it does not in itself cause e.g. timers to fire; they
|
||||
* will fire exactly as they would have done without the call to
|
||||
* jest.setSystemTime().
|
||||
*
|
||||
* > Note: This function is only available when using modern fake timers
|
||||
* > implementation
|
||||
*/
|
||||
function setSystemTime(now?: number | Date): void;
|
||||
/**
|
||||
* When mocking time, Date.now() will also be mocked. If you for some
|
||||
* reason need access to the real current time, you can invoke this
|
||||
* function.
|
||||
*
|
||||
* > Note: This function is only available when using modern fake timers
|
||||
* > implementation
|
||||
*/
|
||||
function getRealSystemTime(): number;
|
||||
/**
|
||||
* Indicates that the module system should never return a mocked version
|
||||
* of the specified module, including all of the specificied module's dependencies.
|
||||
@@ -161,8 +169,10 @@ declare namespace jest {
|
||||
*/
|
||||
function fn<T, Y extends any[]>(implementation?: (...args: Y) => T): Mock<T, Y>;
|
||||
/**
|
||||
* (renamed to `createMockFromModule` in Jest 26.0.0+)
|
||||
* Use the automatic mocking system to generate a mocked version of the given module.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
function genMockFromModule<T>(moduleName: string): T;
|
||||
/**
|
||||
* Returns whether the given function is a mock function.
|
||||
@@ -176,12 +186,14 @@ declare namespace jest {
|
||||
* Returns the actual module instead of a mock, bypassing all checks on
|
||||
* whether the module should receive a mock implementation or not.
|
||||
*/
|
||||
function requireActual<TModule = any>(moduleName: string): TModule;
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
function requireActual<TModule extends {} = any>(moduleName: string): TModule;
|
||||
/**
|
||||
* Returns a mock module instead of the actual module, bypassing all checks
|
||||
* on whether the module should be required normally or not.
|
||||
*/
|
||||
function requireMock<TModule = any>(moduleName: string): TModule;
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
function requireMock<TModule extends {} = any>(moduleName: string): TModule;
|
||||
/**
|
||||
* Resets the module registry - the cache of all required modules. This is
|
||||
* useful to isolate modules where local state might conflict between tests.
|
||||
@@ -242,6 +254,7 @@ declare namespace jest {
|
||||
* Explicitly supplies the mock object that the module system should return
|
||||
* for the specified module.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
function setMock<T>(moduleName: string, moduleExports: T): typeof jest;
|
||||
/**
|
||||
* Set the default timeout interval for tests and before/after hooks in milliseconds.
|
||||
@@ -299,14 +312,14 @@ declare namespace jest {
|
||||
/**
|
||||
* Instructs Jest to use fake versions of the standard timer functions.
|
||||
*/
|
||||
function useFakeTimers(): typeof jest;
|
||||
function useFakeTimers(implementation?: 'modern' | 'legacy'): typeof jest;
|
||||
/**
|
||||
* Instructs Jest to use the real versions of the standard timer functions.
|
||||
*/
|
||||
function useRealTimers(): typeof jest;
|
||||
|
||||
interface MockOptions {
|
||||
virtual?: boolean;
|
||||
virtual?: boolean | undefined;
|
||||
}
|
||||
|
||||
type EmptyFunction = () => void;
|
||||
@@ -439,14 +452,14 @@ declare namespace jest {
|
||||
type MatcherHintColor = (arg: string) => string;
|
||||
|
||||
interface MatcherHintOptions {
|
||||
comment?: string;
|
||||
expectedColor?: MatcherHintColor;
|
||||
isDirectExpectCall?: boolean;
|
||||
isNot?: boolean;
|
||||
promise?: string;
|
||||
receivedColor?: MatcherHintColor;
|
||||
secondArgument?: string;
|
||||
secondArgumentColor?: MatcherHintColor;
|
||||
comment?: string | undefined;
|
||||
expectedColor?: MatcherHintColor | undefined;
|
||||
isDirectExpectCall?: boolean | undefined;
|
||||
isNot?: boolean | undefined;
|
||||
promise?: string | undefined;
|
||||
receivedColor?: MatcherHintColor | undefined;
|
||||
secondArgument?: string | undefined;
|
||||
secondArgumentColor?: MatcherHintColor | undefined;
|
||||
}
|
||||
|
||||
interface ChalkFunction {
|
||||
@@ -548,6 +561,7 @@ declare namespace jest {
|
||||
*
|
||||
* Optionally, you can provide a type for the elements via a generic.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
arrayContaining<E = any>(arr: E[]): any;
|
||||
/**
|
||||
* `expect.not.objectContaining(object)` matches any received object
|
||||
@@ -559,6 +573,7 @@ declare namespace jest {
|
||||
* Optionally, you can provide a type for the object via a generic.
|
||||
* This ensures that the object contains the desired structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
objectContaining<E = {}>(obj: E): any;
|
||||
/**
|
||||
* `expect.not.stringMatching(string | regexp)` matches the received
|
||||
@@ -578,7 +593,7 @@ declare namespace jest {
|
||||
currentTestName: string;
|
||||
expand: boolean;
|
||||
expectedAssertionsNumber: number;
|
||||
isExpectingAssertions?: boolean;
|
||||
isExpectingAssertions?: boolean | undefined;
|
||||
suppressedErrors: Error[];
|
||||
testPath: string;
|
||||
}
|
||||
@@ -632,6 +647,7 @@ declare namespace jest {
|
||||
*
|
||||
* Optionally, you can provide a type for the elements via a generic.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
arrayContaining<E = any>(arr: E[]): any;
|
||||
/**
|
||||
* Verifies that a certain number of assertions are called during a test.
|
||||
@@ -660,6 +676,7 @@ declare namespace jest {
|
||||
* Optionally, you can provide a type for the object via a generic.
|
||||
* This ensures that the object contains the desired structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
objectContaining<E = {}>(obj: E): any;
|
||||
/**
|
||||
* Matches any string that contains the exact provided string
|
||||
@@ -693,6 +710,7 @@ declare namespace jest {
|
||||
type AndNot<T> = T & {
|
||||
not: T
|
||||
};
|
||||
|
||||
// should be R extends void|Promise<void> but getting dtslint error
|
||||
interface Matchers<R, T = {}> {
|
||||
/**
|
||||
@@ -701,13 +719,15 @@ declare namespace jest {
|
||||
* Optionally, you can provide a type for the expected arguments via a generic.
|
||||
* Note that the type must be either an array or a tuple.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
lastCalledWith<E extends any[]>(...args: E): R;
|
||||
/**
|
||||
* Ensure that the last call to a mock function has returned a specified value.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
lastReturnedWith<E = any>(value: E): R;
|
||||
/**
|
||||
* Ensure that a mock function is called with specific arguments on an Nth call.
|
||||
@@ -715,21 +735,24 @@ declare namespace jest {
|
||||
* Optionally, you can provide a type for the expected arguments via a generic.
|
||||
* Note that the type must be either an array or a tuple.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
nthCalledWith<E extends any[]>(nthCall: number, ...params: E): R;
|
||||
/**
|
||||
* Ensure that the nth call to a mock function has returned a specified value.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
nthReturnedWith<E = any>(n: number, value: E): R;
|
||||
/**
|
||||
* Checks that a value is what you expect. It uses `Object.is` to check strict equality.
|
||||
* Don't use `toBe` with floating-point numbers.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toBe<E = any>(expected: E): R;
|
||||
/**
|
||||
* Ensures that a mock function is called.
|
||||
@@ -745,6 +768,7 @@ declare namespace jest {
|
||||
* Optionally, you can provide a type for the expected arguments via a generic.
|
||||
* Note that the type must be either an array or a tuple.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toBeCalledWith<E extends any[]>(...args: E): R;
|
||||
/**
|
||||
* Using exact equality with floating point numbers is a bad idea.
|
||||
@@ -762,29 +786,30 @@ declare namespace jest {
|
||||
*/
|
||||
toBeFalsy(): R;
|
||||
/**
|
||||
* For comparing floating point numbers.
|
||||
* For comparing floating point or big integer numbers.
|
||||
*/
|
||||
toBeGreaterThan(expected: number): R;
|
||||
toBeGreaterThan(expected: number | bigint): R;
|
||||
/**
|
||||
* For comparing floating point numbers.
|
||||
* For comparing floating point or big integer numbers.
|
||||
*/
|
||||
toBeGreaterThanOrEqual(expected: number): R;
|
||||
toBeGreaterThanOrEqual(expected: number | bigint): R;
|
||||
/**
|
||||
* Ensure that an object is an instance of a class.
|
||||
* This matcher uses `instanceof` underneath.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toBeInstanceOf<E = any>(expected: E): R;
|
||||
/**
|
||||
* For comparing floating point numbers.
|
||||
* For comparing floating point or big integer numbers.
|
||||
*/
|
||||
toBeLessThan(expected: number): R;
|
||||
toBeLessThan(expected: number | bigint): R;
|
||||
/**
|
||||
* For comparing floating point numbers.
|
||||
* For comparing floating point or big integer numbers.
|
||||
*/
|
||||
toBeLessThanOrEqual(expected: number): R;
|
||||
toBeLessThanOrEqual(expected: number | bigint): R;
|
||||
/**
|
||||
* This is the same as `.toBe(null)` but the error messages are a bit nicer.
|
||||
* So use `.toBeNull()` when you want to check that something is null.
|
||||
@@ -810,8 +835,9 @@ declare namespace jest {
|
||||
* It can also check whether a string is a substring of another string.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toContain<E = any>(expected: E): R;
|
||||
/**
|
||||
* Used when you want to check that an item is in a list.
|
||||
@@ -819,16 +845,18 @@ declare namespace jest {
|
||||
* equality of all fields, rather than checking for object identity.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toContainEqual<E = any>(expected: E): R;
|
||||
/**
|
||||
* Used when you want to check that two objects have the same value.
|
||||
* This matcher recursively checks the equality of all fields, rather than checking for object identity.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toEqual<E = any>(expected: E): R;
|
||||
/**
|
||||
* Ensures that a mock function is called.
|
||||
@@ -844,6 +872,7 @@ declare namespace jest {
|
||||
* Optionally, you can provide a type for the expected arguments via a generic.
|
||||
* Note that the type must be either an array or a tuple.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toHaveBeenCalledWith<E extends any[]>(...params: E): R;
|
||||
/**
|
||||
* Ensure that a mock function is called with specific arguments on an Nth call.
|
||||
@@ -851,6 +880,7 @@ declare namespace jest {
|
||||
* Optionally, you can provide a type for the expected arguments via a generic.
|
||||
* Note that the type must be either an array or a tuple.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toHaveBeenNthCalledWith<E extends any[]>(nthCall: number, ...params: E): R;
|
||||
/**
|
||||
* If you have a mock function, you can use `.toHaveBeenLastCalledWith`
|
||||
@@ -859,6 +889,7 @@ declare namespace jest {
|
||||
* Optionally, you can provide a type for the expected arguments via a generic.
|
||||
* Note that the type must be either an array or a tuple.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toHaveBeenLastCalledWith<E extends any[]>(...params: E): R;
|
||||
/**
|
||||
* Use to test the specific value that a mock function last returned.
|
||||
@@ -866,8 +897,9 @@ declare namespace jest {
|
||||
* no matter what value you provided as the expected return value.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toHaveLastReturnedWith<E = any>(expected: E): R;
|
||||
/**
|
||||
* Used to check that an object has a `.length` property
|
||||
@@ -880,8 +912,9 @@ declare namespace jest {
|
||||
* no matter what value you provided as the expected return value.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toHaveNthReturnedWith<E = any>(nthCall: number, expected: E): R;
|
||||
/**
|
||||
* Use to check if property at provided reference keyPath exists for an object.
|
||||
@@ -896,6 +929,7 @@ declare namespace jest {
|
||||
*
|
||||
* expect(houseForSale).toHaveProperty('kitchen.area', 20);
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toHaveProperty<E = any>(propertyPath: string | any[], value?: E): R;
|
||||
/**
|
||||
* Use to test that the mock function successfully returned (i.e., did not throw an error) at least one time
|
||||
@@ -910,8 +944,9 @@ declare namespace jest {
|
||||
* Use to ensure that a mock function returned a specific value.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toHaveReturnedWith<E = any>(expected: E): R;
|
||||
/**
|
||||
* Check that a string matches a regular expression.
|
||||
@@ -935,13 +970,15 @@ declare namespace jest {
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* expect(desiredHouse).toMatchObject<House>(...standardHouse, kitchen: {area: 20}) // wherein standardHouse is some base object of type House
|
||||
* expect(desiredHouse).toMatchObject<House>({...standardHouse, kitchen: {area: 20}}) // wherein standardHouse is some base object of type House
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toMatchObject<E extends {} | any[]>(expected: E): R;
|
||||
/**
|
||||
* This ensures that a value matches the most recent snapshot with property matchers.
|
||||
* Check out [the Snapshot Testing guide](http://facebook.github.io/jest/docs/snapshot-testing.html) for more information.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toMatchSnapshot<U extends { [P in keyof T]: any }>(propertyMatchers: Partial<U>, snapshotName?: string): R;
|
||||
/**
|
||||
* This ensures that a value matches the most recent snapshot.
|
||||
@@ -953,6 +990,7 @@ declare namespace jest {
|
||||
* Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically.
|
||||
* Check out [the Snapshot Testing guide](http://facebook.github.io/jest/docs/snapshot-testing.html) for more information.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toMatchInlineSnapshot<U extends { [P in keyof T]: any }>(propertyMatchers: Partial<U>, snapshot?: string): R;
|
||||
/**
|
||||
* This ensures that a value matches the most recent snapshot with property matchers.
|
||||
@@ -972,15 +1010,17 @@ declare namespace jest {
|
||||
* Ensure that a mock function has returned a specified value at least once.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toReturnWith<E = any>(value: E): R;
|
||||
/**
|
||||
* Use to test that objects have the same types as well as structure.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toStrictEqual<E = any>(expected: E): R;
|
||||
/**
|
||||
* Used to test that a function throws when it is called.
|
||||
@@ -993,7 +1033,7 @@ declare namespace jest {
|
||||
/**
|
||||
* Used to test that a function throws a error matching the most recent snapshot when it is called.
|
||||
*/
|
||||
toThrowErrorMatchingSnapshot(): R;
|
||||
toThrowErrorMatchingSnapshot(snapshotName?: string): R;
|
||||
/**
|
||||
* Used to test that a function throws a error matching the most recent snapshot when it is called.
|
||||
* Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically.
|
||||
@@ -1005,8 +1045,6 @@ declare namespace jest {
|
||||
T['length'] extends 0 ? [] :
|
||||
(((...b: T) => void) extends (a: any, ...b: infer I) => void ? I : []);
|
||||
|
||||
type Parameters<T extends (...args: any[]) => any> = T extends (...args: infer P) => any ? P : never;
|
||||
|
||||
interface AsymmetricMatcher {
|
||||
asymmetricMatch(other: unknown): boolean;
|
||||
}
|
||||
@@ -1035,11 +1073,8 @@ declare namespace jest {
|
||||
ExpectProperties &
|
||||
AndNot<CustomAsyncMatchers<TMatchers>> &
|
||||
ExtendedExpectFunction<TMatchers>;
|
||||
/**
|
||||
* Construct a type with the properties of T except for those in type K.
|
||||
*/
|
||||
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
|
||||
type NonPromiseMatchers<T extends JestMatchersShape> = Omit<T, 'resolves' | 'rejects' | 'not'>;
|
||||
|
||||
type NonPromiseMatchers<T extends JestMatchersShape<any>> = Omit<T, 'resolves' | 'rejects' | 'not'>;
|
||||
type PromiseMatchers<T extends JestMatchersShape> = Omit<T['resolves'], 'not'>;
|
||||
|
||||
interface Constructable {
|
||||
@@ -1076,10 +1111,10 @@ declare namespace jest {
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* import { MyClass } from "./libary";
|
||||
* import { MyClass } from "./library";
|
||||
* jest.mock("./library");
|
||||
*
|
||||
* const mockedMyClass = MyClass as jest.MockedClass<MyClass>;
|
||||
* const mockedMyClass = MyClass as jest.MockedClass<typeof MyClass>;
|
||||
*
|
||||
* expect(mockedMyClass.mock.calls[0][0]).toBe(42); // Constructor calls
|
||||
* expect(mockedMyClass.prototype.myMethod.mock.calls[0][0]).toBe(42); // Method calls
|
||||
@@ -1152,7 +1187,7 @@ declare namespace jest {
|
||||
/**
|
||||
* Returns the function that was set as the implementation of the mock (using mockImplementation).
|
||||
*/
|
||||
getMockImplementation(): (...args: Y) => T | undefined;
|
||||
getMockImplementation(): ((...args: Y) => T) | undefined;
|
||||
/**
|
||||
* Accepts a function that should be used as the implementation of the mock. The mock itself will still record
|
||||
* all calls that go into and instances that come from itself – the only difference is that the implementation
|
||||
@@ -1332,6 +1367,7 @@ declare namespace jasmine {
|
||||
function objectContaining(sample: any): ObjectContaining;
|
||||
function createSpy(name?: string, originalFn?: (...args: any[]) => any): Spy;
|
||||
function createSpyObj(baseName: string, methodNames: any[]): any;
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
function createSpyObj<T>(baseName: string, methodNames: any[]): T;
|
||||
function pp(value: any): string;
|
||||
function addCustomEqualityTester(equalityTester: CustomEqualityTester): void;
|
||||
@@ -1476,6 +1512,7 @@ declare namespace jasmine {
|
||||
|
||||
interface MatchersUtil {
|
||||
equals(a: any, b: any, customTesters?: CustomEqualityTester[]): boolean;
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
contains<T>(haystack: ArrayLike<T> | string, needle: any, customTesters?: CustomEqualityTester[]): boolean;
|
||||
buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: any[]): string;
|
||||
}
|
||||
|
28
node_modules/@types/jest/package.json
generated
vendored
Normal file → Executable file
28
node_modules/@types/jest/package.json
generated
vendored
Normal file → Executable file
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"name": "@types/jest",
|
||||
"version": "25.2.3",
|
||||
"version": "26.0.24",
|
||||
"description": "TypeScript definitions for Jest",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
@@ -89,11 +90,6 @@
|
||||
"url": "https://github.com/antoinebrault",
|
||||
"githubUsername": "antoinebrault"
|
||||
},
|
||||
{
|
||||
"name": "Jeroen Claassens",
|
||||
"url": "https://github.com/favna",
|
||||
"githubUsername": "favna"
|
||||
},
|
||||
{
|
||||
"name": "Gregor Stamać",
|
||||
"url": "https://github.com/gstamac",
|
||||
@@ -138,17 +134,15 @@
|
||||
"name": "Regev Brody",
|
||||
"url": "https://github.com/regevbr",
|
||||
"githubUsername": "regevbr"
|
||||
},
|
||||
{
|
||||
"name": "Alexandre Germain",
|
||||
"url": "https://github.com/gerkindev",
|
||||
"githubUsername": "gerkindev"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"typesVersions": {
|
||||
">=3.2.0-0": {
|
||||
"*": [
|
||||
"ts3.2/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
@@ -156,9 +150,9 @@
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"jest-diff": "^25.2.1",
|
||||
"pretty-format": "^25.2.1"
|
||||
"jest-diff": "^26.0.0",
|
||||
"pretty-format": "^26.0.0"
|
||||
},
|
||||
"typesPublisherContentHash": "c17443c55a78b43f5c843e670e87df208c8c341a3354df4f1a233c880653eaf0",
|
||||
"typeScriptVersion": "3.1"
|
||||
"typesPublisherContentHash": "a0a643015335ff74aff8f83ef2952bcc80a1de9559f77e2a8a5f662e98634d64",
|
||||
"typeScriptVersion": "3.8"
|
||||
}
|
23
node_modules/@types/jest/ts3.2/index.d.ts
generated
vendored
23
node_modules/@types/jest/ts3.2/index.d.ts
generated
vendored
@@ -1,23 +0,0 @@
|
||||
// tslint:disable-next-line:no-bad-reference
|
||||
/// <reference path="../index.d.ts" />
|
||||
|
||||
declare namespace jest {
|
||||
interface Matchers<R, T = {}> {
|
||||
/**
|
||||
* For comparing numbers or big integer values.
|
||||
*/
|
||||
toBeGreaterThan(expected: number | bigint): R;
|
||||
/**
|
||||
* For comparing numbers or big integer values.
|
||||
*/
|
||||
toBeGreaterThanOrEqual(expected: number | bigint): R;
|
||||
/**
|
||||
* For comparing numbers or big integer values.
|
||||
*/
|
||||
toBeLessThan(expected: number | bigint): R;
|
||||
/**
|
||||
* For comparing numbers or big integer values.
|
||||
*/
|
||||
toBeLessThanOrEqual(expected: number | bigint): R;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user