Socket
Socket
Sign inDemoInstall

@types/jest

Package Overview
Dependencies
Maintainers
1
Versions
208
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 18.0.0 to 18.1.0

52

jest/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for Jest 18.0.0
// Type definitions for Jest 18.1.0
// Project: http://facebook.github.io/jest/

@@ -30,2 +30,3 @@ // Definitions by: Asana <https://asana.com>, Ivo Stratev <https://github.com/NoHomey>, jwbay <https://github.com/jwbay>, Alexey Svetliakov <https://github.com/asvetliakov>

declare namespace jest {
/** Provides a way to add Jasmine-compatible matchers into your Jest context. */
function addMatchers(matchers: jasmine.CustomMatcherFactories): typeof jest;

@@ -108,4 +109,12 @@ /** Disables automatic mocking in the module loader. */

/** Creates a test closure */
interface It {
/**
* Creates a test closure.
*
* @param {string} name The name of your test
* @param {fn?} ProvidesCallback The function for your test
*/
(name: string, fn?: ProvidesCallback): void;
/** Only runs this test in the current file. */
only: It;

@@ -146,10 +155,22 @@ skip: It;

/** The `expect` function is used every time you want to test a value. You will rarely call `expect` by itself. */
interface Expect {
/**
* The `expect` function is used every time you want to test a value. You will rarely call `expect` by itself.
*
* @param {any} actual The value to apply matchers against.
*/
(actual: any): Matchers;
anything(): void;
/** Matches anything that was created with the given constructor. You can use it inside `toEqual` or `toBeCalledWith` instead of a literal value. */
any(classType: any): void;
/** Matches any array made up entirely of elements in the provided array. You can use it inside `toEqual` or `toBeCalledWith` instead of a literal value. */
arrayContaining(arr: any[]): void;
/** Verifies that a certain number of assertions are called during a test. This is often useful when testing asynchronous code, in order to make sure that assertions in a callback actually got called. */
assertions(num: number): void;
/** You can use `expect.extend` to add your own matchers to Jest. */
extend(obj: ExpectExtendMap): void;
/** Matches any object that recursively matches the provided keys. This is often handy in conjunction with other asymmetric matchers. */
objectContaining(obj: {}): void;
/** Matches any string that contains the exact provided string */
stringMatching(str: string | RegExp): void;

@@ -159,32 +180,61 @@ }

interface Matchers {
/** If you know how to test something, `.not` lets you test its opposite. */
not: Matchers;
lastCalledWith(...args: any[]): void;
/** Checks that a value is what you expect. It uses `===` to check strict equality. Don't use `toBe` with floating-point numbers. */
toBe(expected: any): void;
/** Ensures that a mock function is called. */
toBeCalled(): void;
/** Ensure that a mock function is called with specific arguments. */
toBeCalledWith(...args: any[]): void;
/** Using exact equality with floating point numbers is a bad idea. Rounding means that intuitive things fail. */
toBeCloseTo(expected: number, delta?: number): void;
/** Ensure that a variable is not undefined. */
toBeDefined(): void;
/** When you don't care what a value is, you just want to ensure a value is false in a boolean context. */
toBeFalsy(): void;
/** For comparing floating point numbers. */
toBeGreaterThan(expected: number): void;
/** For comparing floating point numbers. */
toBeGreaterThanOrEqual(expected: number): void;
/** Ensure that an object is an instance of a class. This matcher uses `instanceof` underneath. */
toBeInstanceOf(expected: any): void
/** For comparing floating point numbers. */
toBeLessThan(expected: number): void;
/** For comparing floating point numbers. */
toBeLessThanOrEqual(expected: number): void;
/** 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. */
toBeNull(): void;
/** Use when you don't care what a value is, you just want to ensure a value is true in a boolean context. In JavaScript, there are six falsy values: `false`, `0`, `''`, `null`, `undefined`, and `NaN`. Everything else is truthy. */
toBeTruthy(): void;
/** Used to check that a variable is undefined. */
toBeUndefined(): void;
/** Used when you want to check that an item is in a list. For testing the items in the list, this uses `===`, a strict equality check. */
toContain(expected: any): void;
/** Used when you want to check that an item is in a list. For testing the items in the list, this matcher recursively checks the equality of all fields, rather than checking for object identity. */
toContainEqual(expected: any): void;
/** 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. */
toEqual(expected: any): void;
/** Ensures that a mock function is called. */
toHaveBeenCalled(): boolean;
/** Ensures that a mock function is called an exact number of times. */
toHaveBeenCalledTimes(expected: number): boolean;
/** Ensure that a mock function is called with specific arguments. */
toHaveBeenCalledWith(...params: any[]): boolean;
/** If you have a mock function, you can use `.toHaveBeenLastCalledWith` to test what arguments it was last called with. */
toHaveBeenLastCalledWith(...params: any[]): boolean;
/** Used to check that an object has a `.length` property and it is set to a certain numeric value. */
toHaveLength(expected: number): void;
toHaveProperty(propertyPath: string, value?: any): void;
/** Check that a string matches a regular expression. */
toMatch(expected: string | RegExp): void;
/** Used to check that a JavaScript object matches a subset of the properties of an objec */
toMatchObject(expected: {}): void;
/** This ensures that a value matches the most recent snapshot. Check out [the Snapshot Testing guide](http://facebook.github.io/jest/docs/snapshot-testing.html) for more information. */
toMatchSnapshot(snapshotName?: string): void;
/** Used to test that a function throws when it is called. */
toThrow(): void;
/** If you want to test that a specific error is thrown inside a function. */
toThrowError(error?: string | Constructable | RegExp): void;
/** Used to test that a function throws a error matching the most recent snapshot when it is called. */
toThrowErrorMatchingSnapshot(): void;

@@ -191,0 +241,0 @@ }

4

jest/package.json
{
"name": "@types/jest",
"version": "18.0.0",
"version": "18.1.0",
"description": "TypeScript definitions for Jest",

@@ -15,4 +15,4 @@ "license": "MIT",

"peerDependencies": {},
"typesPublisherContentHash": "ff94b42c05c15cde837e101519d49f021c11f2823a9c247555a02c6b3f4c74fe",
"typesPublisherContentHash": "511043d6cc56ea42f2dabb0213723997bc1b5032f84db39237a6cf961cab4250",
"typeScriptVersion": "2.1"
}

@@ -11,3 +11,3 @@ # Installation

Additional Details
* Last updated: Mon, 30 Jan 2017 18:45:28 GMT
* Last updated: Mon, 30 Jan 2017 20:41:24 GMT
* Dependencies: none

@@ -14,0 +14,0 @@ * Global values: afterAll, afterEach, beforeAll, beforeEach, describe, expect, fail, fdescribe, fit, it, jasmine, jest, pending, spyOn, test, xdescribe, xit, xtest

@@ -10,3 +10,3 @@ {

"libraryMajorVersion": 18,
"libraryMinorVersion": 0,
"libraryMinorVersion": 1,
"typeScriptVersion": "2.1",

@@ -42,5 +42,5 @@ "libraryName": "Jest",

"hasPackageJson": false,
"contentHash": "ff94b42c05c15cde837e101519d49f021c11f2823a9c247555a02c6b3f4c74fe"
"contentHash": "511043d6cc56ea42f2dabb0213723997bc1b5032f84db39237a6cf961cab4250"
},
"isLatest": true
}
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