@casual-simulation/expect 2.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +4 -0
- package/index.d.ts +6 -0
- package/index.js +5 -0
- package/index.js.map +1 -0
- package/package.json +35 -0
- package/src/asymmetricMatchers.d.ts +67 -0
- package/src/asymmetricMatchers.js +188 -0
- package/src/asymmetricMatchers.js.map +1 -0
- package/src/diff/cleanupSemantic.d.ts +58 -0
- package/src/diff/cleanupSemantic.js +526 -0
- package/src/diff/cleanupSemantic.js.map +1 -0
- package/src/diff/constants.d.ts +9 -0
- package/src/diff/constants.js +10 -0
- package/src/diff/constants.js.map +1 -0
- package/src/diff/diffLines.d.ts +13 -0
- package/src/diff/diffLines.js +138 -0
- package/src/diff/diffLines.js.map +1 -0
- package/src/diff/diffStrings.d.ts +10 -0
- package/src/diff/diffStrings.js +36 -0
- package/src/diff/diffStrings.js.map +1 -0
- package/src/diff/getAlignedDiffs.d.ts +11 -0
- package/src/diff/getAlignedDiffs.js +187 -0
- package/src/diff/getAlignedDiffs.js.map +1 -0
- package/src/diff/index.d.ts +16 -0
- package/src/diff/index.js +139 -0
- package/src/diff/index.js.map +1 -0
- package/src/diff/joinAlignedDiffs.d.ts +11 -0
- package/src/diff/joinAlignedDiffs.js +191 -0
- package/src/diff/joinAlignedDiffs.js.map +1 -0
- package/src/diff/normalizeDiffOptions.d.ts +10 -0
- package/src/diff/normalizeDiffOptions.js +40 -0
- package/src/diff/normalizeDiffOptions.js.map +1 -0
- package/src/diff/printDiffs.d.ts +11 -0
- package/src/diff/printDiffs.js +46 -0
- package/src/diff/printDiffs.js.map +1 -0
- package/src/diff/types.d.ts +49 -0
- package/src/diff/types.js +2 -0
- package/src/diff/types.js.map +1 -0
- package/src/diff-sequences/index.d.ts +19 -0
- package/src/diff-sequences/index.js +506 -0
- package/src/diff-sequences/index.js.map +1 -0
- package/src/extractExpectedAssertionsErrors.d.ts +11 -0
- package/src/extractExpectedAssertionsErrors.js +58 -0
- package/src/extractExpectedAssertionsErrors.js.map +1 -0
- package/src/get-type/index.d.ts +11 -0
- package/src/get-type/index.js +57 -0
- package/src/get-type/index.js.map +1 -0
- package/src/index.d.ts +16 -0
- package/src/index.js +247 -0
- package/src/index.js.map +1 -0
- package/src/jasmineUtils.d.ts +9 -0
- package/src/jasmineUtils.js +218 -0
- package/src/jasmineUtils.js.map +1 -0
- package/src/jestMatchersObject.d.ts +14 -0
- package/src/jestMatchersObject.js +78 -0
- package/src/jestMatchersObject.js.map +1 -0
- package/src/matcher-utils/Replaceable.d.ts +18 -0
- package/src/matcher-utils/Replaceable.js +57 -0
- package/src/matcher-utils/Replaceable.js.map +1 -0
- package/src/matcher-utils/deepCyclicCopyReplaceable.d.ts +8 -0
- package/src/matcher-utils/deepCyclicCopyReplaceable.js +96 -0
- package/src/matcher-utils/deepCyclicCopyReplaceable.js.map +1 -0
- package/src/matcher-utils/index.d.ts +53 -0
- package/src/matcher-utils/index.js +341 -0
- package/src/matcher-utils/index.js.map +1 -0
- package/src/matchers.d.ts +11 -0
- package/src/matchers.js +575 -0
- package/src/matchers.js.map +1 -0
- package/src/message-util/index.d.ts +11 -0
- package/src/message-util/index.js +34 -0
- package/src/message-util/index.js.map +1 -0
- package/src/pretty-format/collections.d.ts +33 -0
- package/src/pretty-format/collections.js +130 -0
- package/src/pretty-format/collections.js.map +1 -0
- package/src/pretty-format/index.d.ts +25 -0
- package/src/pretty-format/index.js +390 -0
- package/src/pretty-format/index.js.map +1 -0
- package/src/pretty-format/plugins/AsymmetricMatcher.d.ts +12 -0
- package/src/pretty-format/plugins/AsymmetricMatcher.js +53 -0
- package/src/pretty-format/plugins/AsymmetricMatcher.js.map +1 -0
- package/src/pretty-format/plugins/ConvertAnsi.d.ts +12 -0
- package/src/pretty-format/plugins/ConvertAnsi.js +58 -0
- package/src/pretty-format/plugins/ConvertAnsi.js.map +1 -0
- package/src/pretty-format/plugins/DOMCollection.d.ts +12 -0
- package/src/pretty-format/plugins/DOMCollection.js +39 -0
- package/src/pretty-format/plugins/DOMCollection.js.map +1 -0
- package/src/pretty-format/plugins/DOMElement.d.ts +12 -0
- package/src/pretty-format/plugins/DOMElement.js +68 -0
- package/src/pretty-format/plugins/DOMElement.js.map +1 -0
- package/src/pretty-format/plugins/Immutable.d.ts +12 -0
- package/src/pretty-format/plugins/Immutable.js +113 -0
- package/src/pretty-format/plugins/Immutable.js.map +1 -0
- package/src/pretty-format/plugins/ReactTestComponent.d.ts +19 -0
- package/src/pretty-format/plugins/ReactTestComponent.js +29 -0
- package/src/pretty-format/plugins/ReactTestComponent.js.map +1 -0
- package/src/pretty-format/plugins/lib/escapeHTML.d.ts +8 -0
- package/src/pretty-format/plugins/lib/escapeHTML.js +10 -0
- package/src/pretty-format/plugins/lib/escapeHTML.js.map +1 -0
- package/src/pretty-format/plugins/lib/markup.d.ts +14 -0
- package/src/pretty-format/plugins/lib/markup.js +98 -0
- package/src/pretty-format/plugins/lib/markup.js.map +1 -0
- package/src/pretty-format/types.d.ts +109 -0
- package/src/pretty-format/types.js +8 -0
- package/src/pretty-format/types.js.map +1 -0
- package/src/print.d.ts +16 -0
- package/src/print.js +71 -0
- package/src/print.js.map +1 -0
- package/src/spyMatchers.d.ts +10 -0
- package/src/spyMatchers.js +766 -0
- package/src/spyMatchers.js.map +1 -0
- package/src/test-utils/ConditionalTest.d.ts +10 -0
- package/src/test-utils/ConditionalTest.js +25 -0
- package/src/test-utils/ConditionalTest.js.map +1 -0
- package/src/test-utils/alignedAnsiStyleSerializer.d.ts +9 -0
- package/src/test-utils/alignedAnsiStyleSerializer.js +46 -0
- package/src/test-utils/alignedAnsiStyleSerializer.js.map +1 -0
- package/src/test-utils/config.d.ts +10 -0
- package/src/test-utils/config.js +143 -0
- package/src/test-utils/config.js.map +1 -0
- package/src/test-utils/index.d.ts +10 -0
- package/src/test-utils/index.js +10 -0
- package/src/test-utils/index.js.map +1 -0
- package/src/toThrowMatchers.d.ts +12 -0
- package/src/toThrowMatchers.js +258 -0
- package/src/toThrowMatchers.js.map +1 -0
- package/src/types.d.ts +327 -0
- package/src/types.js +9 -0
- package/src/types.js.map +1 -0
- package/src/utils.d.ts +26 -0
- package/src/utils.js +303 -0
- package/src/utils.js.map +1 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
// get the type of a value with handling the edge cases like `typeof []`
|
|
8
|
+
// and `typeof null`
|
|
9
|
+
export function getType(value) {
|
|
10
|
+
if (value === undefined) {
|
|
11
|
+
return 'undefined';
|
|
12
|
+
}
|
|
13
|
+
else if (value === null) {
|
|
14
|
+
return 'null';
|
|
15
|
+
}
|
|
16
|
+
else if (Array.isArray(value)) {
|
|
17
|
+
return 'array';
|
|
18
|
+
}
|
|
19
|
+
else if (typeof value === 'boolean') {
|
|
20
|
+
return 'boolean';
|
|
21
|
+
}
|
|
22
|
+
else if (typeof value === 'function') {
|
|
23
|
+
return 'function';
|
|
24
|
+
}
|
|
25
|
+
else if (typeof value === 'number') {
|
|
26
|
+
return 'number';
|
|
27
|
+
}
|
|
28
|
+
else if (typeof value === 'string') {
|
|
29
|
+
return 'string';
|
|
30
|
+
}
|
|
31
|
+
else if (typeof value === 'bigint') {
|
|
32
|
+
return 'bigint';
|
|
33
|
+
}
|
|
34
|
+
else if (typeof value === 'object') {
|
|
35
|
+
if (value != null) {
|
|
36
|
+
if (value.constructor === RegExp) {
|
|
37
|
+
return 'regexp';
|
|
38
|
+
}
|
|
39
|
+
else if (value.constructor === Map) {
|
|
40
|
+
return 'map';
|
|
41
|
+
}
|
|
42
|
+
else if (value.constructor === Set) {
|
|
43
|
+
return 'set';
|
|
44
|
+
}
|
|
45
|
+
else if (value.constructor === Date) {
|
|
46
|
+
return 'date';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return 'object';
|
|
50
|
+
}
|
|
51
|
+
else if (typeof value === 'symbol') {
|
|
52
|
+
return 'symbol';
|
|
53
|
+
}
|
|
54
|
+
throw new Error(`value of unknown type: ${value}`);
|
|
55
|
+
}
|
|
56
|
+
export const isPrimitive = (value) => Object(value) !== value;
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkBH,wEAAwE;AACxE,oBAAoB;AACpB,MAAM,UAAU,OAAO,CAAC,KAAc;IAClC,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,WAAW,CAAC;KACtB;SAAM,IAAI,KAAK,KAAK,IAAI,EAAE;QACvB,OAAO,MAAM,CAAC;KACjB;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAC7B,OAAO,OAAO,CAAC;KAClB;SAAM,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;QACnC,OAAO,SAAS,CAAC;KACpB;SAAM,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;QACpC,OAAO,UAAU,CAAC;KACrB;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAClC,OAAO,QAAQ,CAAC;KACnB;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAClC,OAAO,QAAQ,CAAC;KACnB;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAClC,OAAO,QAAQ,CAAC;KACnB;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAClC,IAAI,KAAK,IAAI,IAAI,EAAE;YACf,IAAI,KAAK,CAAC,WAAW,KAAK,MAAM,EAAE;gBAC9B,OAAO,QAAQ,CAAC;aACnB;iBAAM,IAAI,KAAK,CAAC,WAAW,KAAK,GAAG,EAAE;gBAClC,OAAO,KAAK,CAAC;aAChB;iBAAM,IAAI,KAAK,CAAC,WAAW,KAAK,GAAG,EAAE;gBAClC,OAAO,KAAK,CAAC;aAChB;iBAAM,IAAI,KAAK,CAAC,WAAW,KAAK,IAAI,EAAE;gBACnC,OAAO,MAAM,CAAC;aACjB;SACJ;QACD,OAAO,QAAQ,CAAC;KACnB;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAClC,OAAO,QAAQ,CAAC;KACnB;IAED,MAAM,IAAI,KAAK,CAAC,0BAA0B,KAAK,EAAE,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAc,EAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC"}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { Expect, MatcherState as JestMatcherState, Matchers as MatcherInterface } from './types';
|
|
9
|
+
declare const expectExport: Expect<JestMatcherState>;
|
|
10
|
+
declare namespace expectExport {
|
|
11
|
+
type MatcherState = JestMatcherState;
|
|
12
|
+
interface Matchers<R, T = unknown> extends MatcherInterface<R, T> {
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export default expectExport;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
package/src/index.js
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
/* eslint-disable local/prefer-spread-eventually */
|
|
9
|
+
import * as matcherUtils from './matcher-utils';
|
|
10
|
+
import { any, anything, arrayContaining, arrayNotContaining, objectContaining, objectNotContaining, stringContaining, stringMatching, stringNotContaining, stringNotMatching, } from './asymmetricMatchers';
|
|
11
|
+
import extractExpectedAssertionsErrors from './extractExpectedAssertionsErrors';
|
|
12
|
+
import { equals } from './jasmineUtils';
|
|
13
|
+
import { INTERNAL_MATCHER_FLAG, getMatchers, getState, setMatchers, setState, } from './jestMatchersObject';
|
|
14
|
+
import matchers from './matchers';
|
|
15
|
+
import spyMatchers from './spyMatchers';
|
|
16
|
+
import toThrowMatchers, { createMatcher as createThrowMatcher, } from './toThrowMatchers';
|
|
17
|
+
import { iterableEquality, subsetEquality } from './utils';
|
|
18
|
+
class JestAssertionError extends Error {
|
|
19
|
+
}
|
|
20
|
+
const isPromise = (obj) => !!obj &&
|
|
21
|
+
(typeof obj === 'object' || typeof obj === 'function') &&
|
|
22
|
+
typeof obj.then === 'function';
|
|
23
|
+
const createToThrowErrorMatchingSnapshotMatcher = function (matcher) {
|
|
24
|
+
return function (received, testNameOrInlineSnapshot) {
|
|
25
|
+
return matcher.apply(this, [received, testNameOrInlineSnapshot, true]);
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
const getPromiseMatcher = (name, matcher) => {
|
|
29
|
+
if (name === 'toThrow' || name === 'toThrowError') {
|
|
30
|
+
return createThrowMatcher(name, true);
|
|
31
|
+
}
|
|
32
|
+
else if (name === 'toThrowErrorMatchingSnapshot' ||
|
|
33
|
+
name === 'toThrowErrorMatchingInlineSnapshot') {
|
|
34
|
+
return createToThrowErrorMatchingSnapshotMatcher(matcher);
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
};
|
|
38
|
+
const expect = (actual, ...rest) => {
|
|
39
|
+
if (rest.length !== 0) {
|
|
40
|
+
throw new Error('Expect takes at most one argument.');
|
|
41
|
+
}
|
|
42
|
+
const allMatchers = getMatchers();
|
|
43
|
+
const expectation = {
|
|
44
|
+
not: {},
|
|
45
|
+
rejects: { not: {} },
|
|
46
|
+
resolves: { not: {} },
|
|
47
|
+
};
|
|
48
|
+
const err = new JestAssertionError();
|
|
49
|
+
Object.keys(allMatchers).forEach((name) => {
|
|
50
|
+
const matcher = allMatchers[name];
|
|
51
|
+
const promiseMatcher = getPromiseMatcher(name, matcher) || matcher;
|
|
52
|
+
expectation[name] = makeThrowingMatcher(matcher, false, '', actual);
|
|
53
|
+
expectation.not[name] = makeThrowingMatcher(matcher, true, '', actual);
|
|
54
|
+
expectation.resolves[name] = makeResolveMatcher(name, promiseMatcher, false, actual, err);
|
|
55
|
+
expectation.resolves.not[name] = makeResolveMatcher(name, promiseMatcher, true, actual, err);
|
|
56
|
+
expectation.rejects[name] = makeRejectMatcher(name, promiseMatcher, false, actual, err);
|
|
57
|
+
expectation.rejects.not[name] = makeRejectMatcher(name, promiseMatcher, true, actual, err);
|
|
58
|
+
});
|
|
59
|
+
return expectation;
|
|
60
|
+
};
|
|
61
|
+
const getMessage = (message) => (message && message()) ||
|
|
62
|
+
matcherUtils.RECEIVED_COLOR('No message was specified for this matcher.');
|
|
63
|
+
const makeResolveMatcher = (matcherName, matcher, isNot, actual, outerErr) => (...args) => {
|
|
64
|
+
const options = {
|
|
65
|
+
isNot,
|
|
66
|
+
promise: 'resolves',
|
|
67
|
+
};
|
|
68
|
+
if (!isPromise(actual)) {
|
|
69
|
+
throw new JestAssertionError(matcherUtils.matcherErrorMessage(matcherUtils.matcherHint(matcherName, undefined, '', options), `${matcherUtils.RECEIVED_COLOR('received')} value must be a promise`, matcherUtils.printWithType('Received', actual, matcherUtils.printReceived)));
|
|
70
|
+
}
|
|
71
|
+
const innerErr = new JestAssertionError();
|
|
72
|
+
return actual.then((result) => makeThrowingMatcher(matcher, isNot, 'resolves', result, innerErr).apply(null, args), (reason) => {
|
|
73
|
+
outerErr.message =
|
|
74
|
+
matcherUtils.matcherHint(matcherName, undefined, '', options) +
|
|
75
|
+
'\n\n' +
|
|
76
|
+
`Received promise rejected instead of resolved\n` +
|
|
77
|
+
`Rejected to value: ${matcherUtils.printReceived(reason)}`;
|
|
78
|
+
return Promise.reject(outerErr);
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
const makeRejectMatcher = (matcherName, matcher, isNot, actual, outerErr) => (...args) => {
|
|
82
|
+
const options = {
|
|
83
|
+
isNot,
|
|
84
|
+
promise: 'rejects',
|
|
85
|
+
};
|
|
86
|
+
const actualWrapper = typeof actual === 'function' ? actual() : actual;
|
|
87
|
+
if (!isPromise(actualWrapper)) {
|
|
88
|
+
throw new JestAssertionError(matcherUtils.matcherErrorMessage(matcherUtils.matcherHint(matcherName, undefined, '', options), `${matcherUtils.RECEIVED_COLOR('received')} value must be a promise or a function returning a promise`, matcherUtils.printWithType('Received', actual, matcherUtils.printReceived)));
|
|
89
|
+
}
|
|
90
|
+
const innerErr = new JestAssertionError();
|
|
91
|
+
return actualWrapper.then((result) => {
|
|
92
|
+
outerErr.message =
|
|
93
|
+
matcherUtils.matcherHint(matcherName, undefined, '', options) +
|
|
94
|
+
'\n\n' +
|
|
95
|
+
`Received promise resolved instead of rejected\n` +
|
|
96
|
+
`Resolved to value: ${matcherUtils.printReceived(result)}`;
|
|
97
|
+
return Promise.reject(outerErr);
|
|
98
|
+
}, (reason) => makeThrowingMatcher(matcher, isNot, 'rejects', reason, innerErr).apply(null, args));
|
|
99
|
+
};
|
|
100
|
+
const makeThrowingMatcher = (matcher, isNot, promise, actual, err) => function throwingMatcher(...args) {
|
|
101
|
+
let throws = true;
|
|
102
|
+
const utils = Object.assign(Object.assign({}, matcherUtils), { iterableEquality, subsetEquality });
|
|
103
|
+
const matcherContext = Object.assign(Object.assign({
|
|
104
|
+
// When throws is disabled, the matcher will not throw errors during test
|
|
105
|
+
// execution but instead add them to the global matcher state. If a
|
|
106
|
+
// matcher throws, test execution is normally stopped immediately. The
|
|
107
|
+
// snapshot matcher uses it because we want to log all snapshot
|
|
108
|
+
// failures in a test.
|
|
109
|
+
dontThrow: () => (throws = false) }, getState()), { equals, error: err, isNot,
|
|
110
|
+
promise,
|
|
111
|
+
utils });
|
|
112
|
+
const processResult = (result, asyncError) => {
|
|
113
|
+
_validateResult(result);
|
|
114
|
+
getState().assertionCalls++;
|
|
115
|
+
if ((result.pass && isNot) || (!result.pass && !isNot)) {
|
|
116
|
+
// XOR
|
|
117
|
+
const message = getMessage(result.message);
|
|
118
|
+
let error;
|
|
119
|
+
if (err) {
|
|
120
|
+
error = err;
|
|
121
|
+
error.message = message;
|
|
122
|
+
}
|
|
123
|
+
else if (asyncError) {
|
|
124
|
+
error = asyncError;
|
|
125
|
+
error.message = message;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
error = new JestAssertionError(message);
|
|
129
|
+
// Try to remove this function from the stack trace frame.
|
|
130
|
+
// Guard for some environments (browsers) that do not support this feature.
|
|
131
|
+
if (Error.captureStackTrace) {
|
|
132
|
+
Error.captureStackTrace(error, throwingMatcher);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// Passing the result of the matcher with the error so that a custom
|
|
136
|
+
// reporter could access the actual and expected objects of the result
|
|
137
|
+
// for example in order to display a custom visual diff
|
|
138
|
+
error.matcherResult = Object.assign(Object.assign({}, result), { message });
|
|
139
|
+
if (throws) {
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
getState().suppressedErrors.push(error);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const handleError = (error) => {
|
|
148
|
+
if (matcher[INTERNAL_MATCHER_FLAG] === true &&
|
|
149
|
+
!(error instanceof JestAssertionError) &&
|
|
150
|
+
error.name !== 'PrettyFormatPluginError' &&
|
|
151
|
+
// Guard for some environments (browsers) that do not support this feature.
|
|
152
|
+
Error.captureStackTrace) {
|
|
153
|
+
// Try to remove this and deeper functions from the stack trace frame.
|
|
154
|
+
Error.captureStackTrace(error, throwingMatcher);
|
|
155
|
+
}
|
|
156
|
+
throw error;
|
|
157
|
+
};
|
|
158
|
+
let potentialResult;
|
|
159
|
+
try {
|
|
160
|
+
potentialResult =
|
|
161
|
+
matcher[INTERNAL_MATCHER_FLAG] === true
|
|
162
|
+
? matcher.call(matcherContext, actual, ...args)
|
|
163
|
+
: // It's a trap specifically for inline snapshot to capture this name
|
|
164
|
+
// in the stack trace, so that it can correctly get the custom matcher
|
|
165
|
+
// function call.
|
|
166
|
+
(function __EXTERNAL_MATCHER_TRAP__() {
|
|
167
|
+
return matcher.call(matcherContext, actual, ...args);
|
|
168
|
+
})();
|
|
169
|
+
if (isPromise(potentialResult)) {
|
|
170
|
+
const asyncResult = potentialResult;
|
|
171
|
+
const asyncError = new JestAssertionError();
|
|
172
|
+
if (Error.captureStackTrace) {
|
|
173
|
+
Error.captureStackTrace(asyncError, throwingMatcher);
|
|
174
|
+
}
|
|
175
|
+
return asyncResult
|
|
176
|
+
.then((aResult) => processResult(aResult, asyncError))
|
|
177
|
+
.catch(handleError);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
const syncResult = potentialResult;
|
|
181
|
+
return processResult(syncResult);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
return handleError(error);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
expect.extend = (matchers) => setMatchers(matchers, false, expect);
|
|
189
|
+
expect.anything = anything;
|
|
190
|
+
expect.any = any;
|
|
191
|
+
expect.not = {
|
|
192
|
+
arrayContaining: arrayNotContaining,
|
|
193
|
+
objectContaining: objectNotContaining,
|
|
194
|
+
stringContaining: stringNotContaining,
|
|
195
|
+
stringMatching: stringNotMatching,
|
|
196
|
+
};
|
|
197
|
+
expect.objectContaining = objectContaining;
|
|
198
|
+
expect.arrayContaining = arrayContaining;
|
|
199
|
+
expect.stringContaining = stringContaining;
|
|
200
|
+
expect.stringMatching = stringMatching;
|
|
201
|
+
const _validateResult = (result) => {
|
|
202
|
+
if (typeof result !== 'object' ||
|
|
203
|
+
typeof result.pass !== 'boolean' ||
|
|
204
|
+
(result.message &&
|
|
205
|
+
typeof result.message !== 'string' &&
|
|
206
|
+
typeof result.message !== 'function')) {
|
|
207
|
+
throw new Error('Unexpected return from a matcher function.\n' +
|
|
208
|
+
'Matcher functions should ' +
|
|
209
|
+
'return an object in the following format:\n' +
|
|
210
|
+
' {message?: string | function, pass: boolean}\n' +
|
|
211
|
+
`'${matcherUtils.stringify(result)}' was returned`);
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
function assertions(expected) {
|
|
215
|
+
const error = new Error();
|
|
216
|
+
if (Error.captureStackTrace) {
|
|
217
|
+
Error.captureStackTrace(error, assertions);
|
|
218
|
+
}
|
|
219
|
+
setState({
|
|
220
|
+
expectedAssertionsNumber: expected,
|
|
221
|
+
expectedAssertionsNumberError: error,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
function hasAssertions(...args) {
|
|
225
|
+
const error = new Error();
|
|
226
|
+
if (Error.captureStackTrace) {
|
|
227
|
+
Error.captureStackTrace(error, hasAssertions);
|
|
228
|
+
}
|
|
229
|
+
matcherUtils.ensureNoExpected(args[0], '.hasAssertions');
|
|
230
|
+
setState({
|
|
231
|
+
isExpectingAssertions: true,
|
|
232
|
+
isExpectingAssertionsError: error,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
// add default jest matchers
|
|
236
|
+
setMatchers(matchers, true, expect);
|
|
237
|
+
setMatchers(spyMatchers, true, expect);
|
|
238
|
+
setMatchers(toThrowMatchers, true, expect);
|
|
239
|
+
expect.addSnapshotSerializer = (() => void 0);
|
|
240
|
+
expect.assertions = assertions;
|
|
241
|
+
expect.hasAssertions = hasAssertions;
|
|
242
|
+
expect.getState = getState;
|
|
243
|
+
expect.setState = setState;
|
|
244
|
+
expect.extractExpectedAssertionsErrors = extractExpectedAssertionsErrors;
|
|
245
|
+
const expectExport = expect;
|
|
246
|
+
export default expectExport;
|
|
247
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,mDAAmD;AAEnD,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACH,GAAG,EACH,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,+BAA+B,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EACH,qBAAqB,EACrB,WAAW,EACX,QAAQ,EACR,WAAW,EACX,QAAQ,GACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,eAAe,EAAE,EACpB,aAAa,IAAI,kBAAkB,GACtC,MAAM,mBAAmB,CAAC;AAa3B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE3D,MAAM,kBAAmB,SAAQ,KAAK;CAIrC;AAED,MAAM,SAAS,GAAG,CAAgB,GAAQ,EAAyB,EAAE,CACjE,CAAC,CAAC,GAAG;IACL,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,UAAU,CAAC;IACtD,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,CAAC;AAEnC,MAAM,yCAAyC,GAAG,UAC9C,OAAqB;IAErB,OAAO,UAEH,QAAa,EACb,wBAAiC;QAEjC,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,wBAAwB,EAAE,IAAI,CAAC,CAAC,CAAC;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,EAAE,gBAAgB,CAAC,CAAC;IACzD,QAAQ,CAAC;QACL,qBAAqB,EAAE,IAAI;QAC3B,0BAA0B,EAAE,KAAK;KACpC,CAAC,CAAC;AACP,CAAC;AAED,4BAA4B;AAC5B,WAAW,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAgB,CAAC,CAAC;AAC9C,WAAW,CAAC,WAAW,EAAE,IAAI,EAAE,MAAgB,CAAC,CAAC;AACjD,WAAW,CAAC,eAAe,EAAE,IAAI,EAAE,MAAgB,CAAC,CAAC;AAErD,MAAM,CAAC,qBAAqB,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAc,CAAC;AAC3D,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;AAC/B,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;AACrC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC3B,MAAM,CAAC,+BAA+B,GAAG,+BAA+B,CAAC;AAEzE,MAAM,YAAY,GAAG,MAAgB,CAAC;AAOtC,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Tester } from './types';
|
|
2
|
+
export declare function equals(a: unknown, b: unknown, customTesters?: Array<Tester>, strictCheck?: boolean): boolean;
|
|
3
|
+
export declare function isA(typeName: string, value: unknown): boolean;
|
|
4
|
+
export declare function fnNameFor(func: Function): any;
|
|
5
|
+
export declare function isUndefined(obj: any): boolean;
|
|
6
|
+
export declare function hasProperty(obj: object | null, property: string): boolean;
|
|
7
|
+
export declare function isImmutableUnorderedKeyed(maybeKeyed: any): boolean;
|
|
8
|
+
export declare function isImmutableUnorderedSet(maybeSet: any): boolean;
|
|
9
|
+
//# sourceMappingURL=jasmineUtils.d.ts.map
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2008-2016 Pivotal Labs
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
5
|
+
a copy of this software and associated documentation files (the
|
|
6
|
+
"Software"), to deal in the Software without restriction, including
|
|
7
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
8
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
9
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
10
|
+
the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be
|
|
13
|
+
included in all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
19
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
20
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
21
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
|
|
23
|
+
*/
|
|
24
|
+
// Extracted out of jasmine 2.5.2
|
|
25
|
+
export function equals(a, b, customTesters, strictCheck) {
|
|
26
|
+
customTesters = customTesters || [];
|
|
27
|
+
return eq(a, b, [], [], customTesters, strictCheck ? hasKey : hasDefinedKey);
|
|
28
|
+
}
|
|
29
|
+
const functionToString = Function.prototype.toString;
|
|
30
|
+
function isAsymmetric(obj) {
|
|
31
|
+
return !!obj && isA('Function', obj.asymmetricMatch);
|
|
32
|
+
}
|
|
33
|
+
function asymmetricMatch(a, b) {
|
|
34
|
+
var asymmetricA = isAsymmetric(a), asymmetricB = isAsymmetric(b);
|
|
35
|
+
if (asymmetricA && asymmetricB) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
if (asymmetricA) {
|
|
39
|
+
return a.asymmetricMatch(b);
|
|
40
|
+
}
|
|
41
|
+
if (asymmetricB) {
|
|
42
|
+
return b.asymmetricMatch(a);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// Equality function lovingly adapted from isEqual in
|
|
46
|
+
// [Underscore](http://underscorejs.org)
|
|
47
|
+
function eq(a, b, aStack, bStack, customTesters, hasKey) {
|
|
48
|
+
var result = true;
|
|
49
|
+
var asymmetricResult = asymmetricMatch(a, b);
|
|
50
|
+
if (asymmetricResult !== undefined) {
|
|
51
|
+
return asymmetricResult;
|
|
52
|
+
}
|
|
53
|
+
for (var i = 0; i < customTesters.length; i++) {
|
|
54
|
+
var customTesterResult = customTesters[i](a, b);
|
|
55
|
+
if (customTesterResult !== undefined) {
|
|
56
|
+
return customTesterResult;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (a instanceof Error && b instanceof Error) {
|
|
60
|
+
return a.message == b.message;
|
|
61
|
+
}
|
|
62
|
+
if (Object.is(a, b)) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
// A strict comparison is necessary because `null == undefined`.
|
|
66
|
+
if (a === null || b === null) {
|
|
67
|
+
return a === b;
|
|
68
|
+
}
|
|
69
|
+
var className = Object.prototype.toString.call(a);
|
|
70
|
+
if (className != Object.prototype.toString.call(b)) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
switch (className) {
|
|
74
|
+
case '[object Boolean]':
|
|
75
|
+
case '[object String]':
|
|
76
|
+
case '[object Number]':
|
|
77
|
+
if (typeof a !== typeof b) {
|
|
78
|
+
// One is a primitive, one a `new Primitive()`
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
else if (typeof a !== 'object' && typeof b !== 'object') {
|
|
82
|
+
// both are proper primitives
|
|
83
|
+
return Object.is(a, b);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
// both are `new Primitive()`s
|
|
87
|
+
return Object.is(a.valueOf(), b.valueOf());
|
|
88
|
+
}
|
|
89
|
+
case '[object Date]':
|
|
90
|
+
// Coerce dates to numeric primitive values. Dates are compared by their
|
|
91
|
+
// millisecond representations. Note that invalid dates with millisecond representations
|
|
92
|
+
// of `NaN` are not equivalent.
|
|
93
|
+
return +a == +b;
|
|
94
|
+
// RegExps are compared by their source patterns and flags.
|
|
95
|
+
case '[object RegExp]':
|
|
96
|
+
return a.source === b.source && a.flags === b.flags;
|
|
97
|
+
}
|
|
98
|
+
if (typeof a !== 'object' || typeof b !== 'object') {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
// Use DOM3 method isEqualNode (IE>=9)
|
|
102
|
+
if (isDomNode(a) && isDomNode(b)) {
|
|
103
|
+
return a.isEqualNode(b);
|
|
104
|
+
}
|
|
105
|
+
// Used to detect circular references.
|
|
106
|
+
var length = aStack.length;
|
|
107
|
+
while (length--) {
|
|
108
|
+
// Linear search. Performance is inversely proportional to the number of
|
|
109
|
+
// unique nested structures.
|
|
110
|
+
// circular references at same depth are equal
|
|
111
|
+
// circular reference is not equal to non-circular one
|
|
112
|
+
if (aStack[length] === a) {
|
|
113
|
+
return bStack[length] === b;
|
|
114
|
+
}
|
|
115
|
+
else if (bStack[length] === b) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Add the first object to the stack of traversed objects.
|
|
120
|
+
aStack.push(a);
|
|
121
|
+
bStack.push(b);
|
|
122
|
+
// Recursively compare objects and arrays.
|
|
123
|
+
// Compare array lengths to determine if a deep comparison is necessary.
|
|
124
|
+
if (className == '[object Array]' && a.length !== b.length) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
// Deep compare objects.
|
|
128
|
+
var aKeys = keys(a, hasKey), key;
|
|
129
|
+
var size = aKeys.length;
|
|
130
|
+
// Ensure that both objects contain the same number of properties before comparing deep equality.
|
|
131
|
+
if (keys(b, hasKey).length !== size) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
while (size--) {
|
|
135
|
+
key = aKeys[size];
|
|
136
|
+
// Deep compare each member
|
|
137
|
+
result =
|
|
138
|
+
hasKey(b, key) &&
|
|
139
|
+
eq(a[key], b[key], aStack, bStack, customTesters, hasKey);
|
|
140
|
+
if (!result) {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// Remove the first object from the stack of traversed objects.
|
|
145
|
+
aStack.pop();
|
|
146
|
+
bStack.pop();
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
function keys(obj, hasKey) {
|
|
150
|
+
var keys = [];
|
|
151
|
+
for (var key in obj) {
|
|
152
|
+
if (hasKey(obj, key)) {
|
|
153
|
+
keys.push(key);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return keys.concat(Object.getOwnPropertySymbols(obj).filter((symbol) => Object.getOwnPropertyDescriptor(obj, symbol).enumerable));
|
|
157
|
+
}
|
|
158
|
+
function hasDefinedKey(obj, key) {
|
|
159
|
+
return hasKey(obj, key) && obj[key] !== undefined;
|
|
160
|
+
}
|
|
161
|
+
function hasKey(obj, key) {
|
|
162
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
163
|
+
}
|
|
164
|
+
export function isA(typeName, value) {
|
|
165
|
+
return (Object.prototype.toString.apply(value) === '[object ' + typeName + ']');
|
|
166
|
+
}
|
|
167
|
+
function isDomNode(obj) {
|
|
168
|
+
return (obj !== null &&
|
|
169
|
+
typeof obj === 'object' &&
|
|
170
|
+
typeof obj.nodeType === 'number' &&
|
|
171
|
+
typeof obj.nodeName === 'string' &&
|
|
172
|
+
typeof obj.isEqualNode === 'function');
|
|
173
|
+
}
|
|
174
|
+
export function fnNameFor(func) {
|
|
175
|
+
if (func.name) {
|
|
176
|
+
return func.name;
|
|
177
|
+
}
|
|
178
|
+
const matches = functionToString
|
|
179
|
+
.call(func)
|
|
180
|
+
.match(/^(?:async)?\s*function\s*\*?\s*([\w$]+)\s*\(/);
|
|
181
|
+
return matches ? matches[1] : '<anonymous>';
|
|
182
|
+
}
|
|
183
|
+
export function isUndefined(obj) {
|
|
184
|
+
return obj === void 0;
|
|
185
|
+
}
|
|
186
|
+
function getPrototype(obj) {
|
|
187
|
+
if (Object.getPrototypeOf) {
|
|
188
|
+
return Object.getPrototypeOf(obj);
|
|
189
|
+
}
|
|
190
|
+
if (obj.constructor.prototype == obj) {
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
return obj.constructor.prototype;
|
|
194
|
+
}
|
|
195
|
+
export function hasProperty(obj, property) {
|
|
196
|
+
if (!obj) {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
if (Object.prototype.hasOwnProperty.call(obj, property)) {
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
return hasProperty(getPrototype(obj), property);
|
|
203
|
+
}
|
|
204
|
+
// SENTINEL constants are from https://github.com/facebook/immutable-js
|
|
205
|
+
const IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
|
|
206
|
+
const IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';
|
|
207
|
+
const IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
|
|
208
|
+
export function isImmutableUnorderedKeyed(maybeKeyed) {
|
|
209
|
+
return !!(maybeKeyed &&
|
|
210
|
+
maybeKeyed[IS_KEYED_SENTINEL] &&
|
|
211
|
+
!maybeKeyed[IS_ORDERED_SENTINEL]);
|
|
212
|
+
}
|
|
213
|
+
export function isImmutableUnorderedSet(maybeSet) {
|
|
214
|
+
return !!(maybeSet &&
|
|
215
|
+
maybeSet[IS_SET_SENTINEL] &&
|
|
216
|
+
!maybeSet[IS_ORDERED_SENTINEL]);
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=jasmineUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jasmine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IAAI,GAAG,EAAE;QAClC,OAAO,IAAI,CAAC;KACf;IAED,OAAO,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAkB,EAAE,QAAgB;IAC5D,IAAI,CAAC,GAAG,EAAE;QACN,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE;QACrD,OAAO,IAAI,CAAC;KACf;IAED,OAAO,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC;AACpD,CAAC;AAED,uEAAuE;AACvE,MAAM,iBAAiB,GAAG,yBAAyB,CAAC;AACpD,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAChD,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AAExD,MAAM,UAAU,yBAAyB,CAAC,UAAe;IACrD,OAAO,CAAC,CAAC,CACL,UAAU;QACV,UAAU,CAAC,iBAAiB,CAAC;QAC7B,CAAC,UAAU,CAAC,mBAAmB,CAAC,CACnC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,QAAa;IACjD,OAAO,CAAC,CAAC,CACL,QAAQ;QACR,QAAQ,CAAC,eAAe,CAAC;QACzB,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CACjC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { Expect, MatcherState, MatchersObject } from './types';
|
|
9
|
+
export declare const INTERNAL_MATCHER_FLAG: unique symbol;
|
|
10
|
+
export declare const getState: <State extends MatcherState = MatcherState>() => State;
|
|
11
|
+
export declare const setState: <State extends MatcherState = MatcherState>(state: Partial<State>) => void;
|
|
12
|
+
export declare const getMatchers: <State extends MatcherState = MatcherState>() => MatchersObject<State>;
|
|
13
|
+
export declare const setMatchers: <State extends MatcherState = MatcherState>(matchers: MatchersObject<State>, isInternal: boolean, expect: Expect) => void;
|
|
14
|
+
//# sourceMappingURL=jestMatchersObject.d.ts.map
|