Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/jest

Package Overview
Dependencies
Maintainers
1
Versions
209
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/jest - npm Package Compare versions

Comparing version 23.3.13 to 23.3.14

53

jest/index.d.ts

@@ -20,4 +20,5 @@ // Type definitions for Jest 23.3

// Andy <https://github.com/andys8>
// Antoine Brault <https://github.com/antoinebrault>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// TypeScript Version: 3.0

@@ -39,2 +40,4 @@ declare var beforeAll: jest.Lifecycle;

type ArgsType<T> = T extends (...args: infer A) => any ? A : never;
interface NodeRequire {

@@ -119,7 +122,7 @@ /**

*/
function fn<T extends {}>(implementation: (...args: any[]) => T): Mock<T>;
function fn(): Mock;
/**
* Creates a mock function. Optionally takes a mock implementation.
*/
function fn<T>(implementation?: (...args: any[]) => any): Mock<T>;
function fn<T, Y extends any[]>(implementation: (...args: Y) => T): Mock<T, Y>;
/**

@@ -132,3 +135,3 @@ * Use the automatic mocking system to generate a mocked version of the given module.

*/
function isMockFunction(fn: any): fn is Mock<any>;
function isMockFunction(fn: any): fn is Mock;
/**

@@ -219,3 +222,5 @@ * Mocks a module with an auto-mocked version when it is being required.

*/
function spyOn<T extends {}, M extends keyof T>(object: T, method: M, accessType?: 'get' | 'set'): SpyInstance<T[M]>;
function spyOn<T extends {}, M extends keyof T>(object: T, method: M, accessType: 'get'): SpyInstance<T[M], []>;
function spyOn<T extends {}, M extends keyof T>(object: T, method: M, accessType: 'set'): SpyInstance<void, [T[M]]>;
function 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;
/**

@@ -784,8 +789,8 @@ * Indicates that the module system should never return a mocked version of

interface Mock<T = {}> extends Function, MockInstance<T> {
new (...args: any[]): T;
(...args: any[]): any;
interface Mock<T = any, Y extends any[] = any> extends Function, MockInstance<T, Y> {
new (...args: Y): T;
(...args: Y): T;
}
interface SpyInstance<T = {}> extends MockInstance<T> {}
interface SpyInstance<T = any, Y extends any[] = any> extends MockInstance<T, Y> {}

@@ -804,10 +809,10 @@ /**

type Mocked<T> = {
[P in keyof T]: T[P] & MockInstance<T[P]>;
[P in keyof T]: T[P] & MockInstance<T[P], ArgsType<T[P]>>;
} & T;
interface MockInstance<T> {
interface MockInstance<T, Y extends any[]> {
/** Returns the mock name string set by calling `mockFn.mockName(value)`. */
getMockName(): string;
/** Provides access to the mock's metadata */
mock: MockContext<T>;
mock: MockContext<T, Y>;
/**

@@ -852,3 +857,3 @@ * Resets all information stored in the mockFn.mock.calls and mockFn.mock.instances arrays.

*/
mockImplementation(fn?: (...args: any[]) => any): Mock<T>;
mockImplementation(fn?: (...args: Y) => T): Mock<T, Y>;
/**

@@ -869,5 +874,5 @@ * Accepts a function that will be used as an implementation of the mock for one call to the mocked function.

*/
mockImplementationOnce(fn: (...args: any[]) => any): Mock<T>;
mockImplementationOnce(fn: (...args: Y) => T): Mock<T, Y>;
/** Sets the name of the mock`. */
mockName(name: string): Mock<T>;
mockName(name: string): Mock<T, Y>;
/**

@@ -882,3 +887,3 @@ * Just a simple sugar function for:

*/
mockReturnThis(): Mock<T>;
mockReturnThis(): Mock<T, Y>;
/**

@@ -895,3 +900,3 @@ * Accepts a value that will be returned whenever the mock function is called.

*/
mockReturnValue(value: any): Mock<T>;
mockReturnValue(value: T): Mock<T, Y>;
/**

@@ -913,7 +918,7 @@ * Accepts a value that will be returned for one call to the mock function. Can be chained so that

*/
mockReturnValueOnce(value: any): Mock<T>;
mockReturnValueOnce(value: T): Mock<T, Y>;
/**
* Simple sugar function for: `jest.fn().mockImplementation(() => Promise.resolve(value));`
*/
mockResolvedValue(value: any): Mock<T>;
mockResolvedValue(value: T | PromiseLike<T>): Mock<Promise<T>, Y>;
/**

@@ -938,3 +943,3 @@ * Simple sugar function for: `jest.fn().mockImplementationOnce(() => Promise.resolve(value));`

*/
mockResolvedValueOnce(value: any): Mock<T>;
mockResolvedValueOnce(value: T | PromiseLike<T>): Mock<Promise<T>, Y>;
/**

@@ -951,3 +956,3 @@ * Simple sugar function for: `jest.fn().mockImplementation(() => Promise.reject(value));`

*/
mockRejectedValue(value: any): Mock<T>;
mockRejectedValue(value: any): Mock<Promise<T>, Y>;

@@ -970,3 +975,3 @@ /**

*/
mockRejectedValueOnce(value: any): Mock<T>;
mockRejectedValueOnce(value: any): Mock<Promise<T>, Y>;
}

@@ -989,4 +994,4 @@

interface MockContext<T> {
calls: any[][];
interface MockContext<T, Y extends any[]> {
calls: Y[];
instances: T[];

@@ -993,0 +998,0 @@ invocationCallOrder: number[];

{
"name": "@types/jest",
"version": "23.3.13",
"version": "23.3.14",
"description": "TypeScript definitions for Jest",

@@ -90,2 +90,7 @@ "license": "MIT",

"githubUsername": "andys8"
},
{
"name": "Antoine Brault",
"url": "https://github.com/antoinebrault",
"githubUsername": "antoinebrault"
}

@@ -101,4 +106,4 @@ ],

"dependencies": {},
"typesPublisherContentHash": "519c4e79f83f5cb10278094d2cfd91464470eceebc161a1c3e9b115df4b687b8",
"typeScriptVersion": "2.3"
"typesPublisherContentHash": "3fa9b395ccf536633435ecc3b93c6c49263e7f1bf72c0857b6b2467e70e34821",
"typeScriptVersion": "3.0"
}

@@ -5,3 +5,3 @@ # Installation

# Summary
This package contains type definitions for Jest (http://facebook.github.io/jest/).
This package contains type definitions for Jest ( http://facebook.github.io/jest/ ).

@@ -12,3 +12,3 @@ # Details

Additional Details
* Last updated: Fri, 18 Jan 2019 22:44:30 GMT
* Last updated: Tue, 05 Feb 2019 01:10:03 GMT
* Dependencies: none

@@ -18,2 +18,2 @@ * 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>.
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>.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc