Socket
Socket
Sign inDemoInstall

expect

Package Overview
Dependencies
Maintainers
5
Versions
237
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expect - npm Package Compare versions

Comparing version 28.0.0-alpha.1 to 28.0.0-alpha.2

90

build/index.d.ts

@@ -7,3 +7,2 @@ /**

*/
import type {Config} from '@jest/types';
import type {EqualsFunction} from '@jest/expect-utils';

@@ -13,3 +12,3 @@ import type * as jestMatcherUtils from 'jest-matcher-utils';

declare interface AsymmetricMatcher {
declare type AsymmetricMatcher = {
asymmetricMatch(other: unknown): boolean;

@@ -19,3 +18,3 @@ toString(): string;

toAsymmetricMatcher?(): string;
}
};

@@ -34,16 +33,19 @@ export declare interface AsymmetricMatchers {

export declare type Expect<State extends MatcherState = MatcherState> = {
<T = unknown>(actual: T): Matchers<void, T> &
InverseMatchers<void, T> &
PromiseMatchers<T>;
addSnapshotSerializer(serializer: unknown): void;
export declare interface BaseExpect {
assertions(numberOfAssertions: number): void;
extend<T extends MatcherState = State>(matchers: MatchersObject<T>): void;
extend(matchers: MatchersObject): void;
extractExpectedAssertionsErrors(): ExpectedAssertionsErrors;
getState(): State;
getState(): MatcherState;
hasAssertions(): void;
setState(state: Partial<State>): void;
} & AsymmetricMatchers &
InverseAsymmetricMatchers;
setState(state: Partial<MatcherState>): void;
}
export declare type Expect = {
<T = unknown>(actual: T): Matchers<void> &
Inverse<Matchers<void>> &
PromiseMatchers;
} & BaseExpect &
AsymmetricMatchers &
Inverse<Omit<AsymmetricMatchers, 'any' | 'anything'>>;
declare const expect_2: Expect;

@@ -61,16 +63,9 @@ export default expect_2;

declare type InverseAsymmetricMatchers = {
declare type Inverse<Matchers> = {
/**
* Inverse next matcher. If you know how to test something, `.not` lets you test its opposite.
*/
not: Omit<AsymmetricMatchers, 'any' | 'anything'>;
not: Matchers;
};
declare type InverseMatchers<R extends void | Promise<void>, T = unknown> = {
/**
* Inverse next matcher. If you know how to test something, `.not` lets you test its opposite.
*/
not: Matchers<R, T>;
};
export declare class JestAssertionError extends Error {

@@ -90,3 +85,3 @@ matcherResult?: Omit<SyncExpectationResult, 'message'> & {

export declare interface Matchers<R extends void | Promise<void>, T = unknown> {
export declare interface Matchers<R extends void | Promise<void>> {
/**

@@ -301,43 +296,6 @@ * Ensures the last call to a mock function was provided specific args.

toThrowError(expected?: unknown): R;
/**
* This ensures that a value matches the most recent snapshot with property matchers.
* Check out [the Snapshot Testing guide](https://jestjs.io/docs/snapshot-testing) for more information.
*/
toMatchSnapshot(hint?: string): R;
/**
* This ensures that a value matches the most recent snapshot.
* Check out [the Snapshot Testing guide](https://jestjs.io/docs/snapshot-testing) for more information.
*/
toMatchSnapshot<U extends Record<keyof T, unknown>>(
propertyMatchers: Partial<U>,
hint?: string,
): R;
/**
* This ensures that a value matches the most recent snapshot with property matchers.
* 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](https://jestjs.io/docs/snapshot-testing) for more information.
*/
toMatchInlineSnapshot(snapshot?: string): R;
/**
* This ensures that a value matches the most recent snapshot with property matchers.
* 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](https://jestjs.io/docs/snapshot-testing) for more information.
*/
toMatchInlineSnapshot<U extends Record<keyof T, unknown>>(
propertyMatchers: Partial<U>,
snapshot?: string,
): R;
/**
* Used to test that a function throws a error matching the most recent snapshot when it is called.
*/
toThrowErrorMatchingSnapshot(hint?: 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.
*/
toThrowErrorMatchingInlineSnapshot(snapshot?: string): R;
}
declare type MatchersObject<T extends MatcherState = MatcherState> = {
[name: string]: RawMatcherFn<T>;
declare type MatchersObject = {
[name: string]: RawMatcherFn;
};

@@ -359,3 +317,3 @@

suppressedErrors: Array<Error>;
testPath?: Config.Path;
testPath?: string;
utils: typeof jestMatcherUtils & {

@@ -367,3 +325,3 @@ iterableEquality: Tester;

declare type PromiseMatchers<T = unknown> = {
declare type PromiseMatchers = {
/**

@@ -373,3 +331,3 @@ * Unwraps the reason of a rejected promise so any other matcher can be chained.

*/
rejects: Matchers<Promise<void>, T> & InverseMatchers<Promise<void>, T>;
rejects: Matchers<Promise<void>> & Inverse<Matchers<Promise<void>>>;
/**

@@ -379,3 +337,3 @@ * Unwraps the value of a fulfilled promise so any other matcher can be chained.

*/
resolves: Matchers<Promise<void>, T> & InverseMatchers<Promise<void>, T>;
resolves: Matchers<Promise<void>> & Inverse<Matchers<Promise<void>>>;
};

@@ -382,0 +340,0 @@

@@ -464,5 +464,2 @@ 'use strict';

(0, _jestMatchersObject.setMatchers)(_toThrowMatchers.default, true, expect);
expect.addSnapshotSerializer = () => void 0;
expect.assertions = assertions;

@@ -469,0 +466,0 @@ expect.hasAssertions = hasAssertions;

{
"name": "expect",
"version": "28.0.0-alpha.1",
"version": "28.0.0-alpha.2",
"repository": {

@@ -21,10 +21,9 @@ "type": "git",

"dependencies": {
"@jest/expect-utils": "^28.0.0-alpha.1",
"@jest/types": "^28.0.0-alpha.1",
"@jest/expect-utils": "^28.0.0-alpha.2",
"jest-get-type": "^28.0.0-alpha.0",
"jest-matcher-utils": "^28.0.0-alpha.1",
"jest-message-util": "^28.0.0-alpha.1"
"jest-matcher-utils": "^28.0.0-alpha.2",
"jest-message-util": "^28.0.0-alpha.2"
},
"devDependencies": {
"@jest/test-utils": "^28.0.0-alpha.1",
"@jest/test-utils": "^28.0.0-alpha.2",
"@tsd/typescript": "~4.5.5",

@@ -42,3 +41,3 @@ "chalk": "^4.0.0",

},
"gitHead": "d30164dde1847166fa0faec98d20abffd85e6ffd"
"gitHead": "694d6bfea56f9cb49d0c7309cdbfff032da198c2"
}
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