@vitest/expect
Advanced tools
Comparing version 1.0.0-beta.3 to 1.0.0-beta.4
@@ -11,2 +11,3 @@ import { getColors, stringify, isObject, assertTypes } from '@vitest/utils'; | ||
const GLOBAL_EXPECT = Symbol.for("expect-global"); | ||
const ASYMMETRIC_MATCHERS_OBJECT = Symbol.for("asymmetric-matchers-object"); | ||
@@ -16,2 +17,3 @@ if (!Object.prototype.hasOwnProperty.call(globalThis, MATCHERS_OBJECT)) { | ||
const matchers = /* @__PURE__ */ Object.create(null); | ||
const assymetricMatchers = /* @__PURE__ */ Object.create(null); | ||
Object.defineProperty(globalThis, MATCHERS_OBJECT, { | ||
@@ -27,2 +29,5 @@ get: () => globalState | ||
}); | ||
Object.defineProperty(globalThis, ASYMMETRIC_MATCHERS_OBJECT, { | ||
get: () => assymetricMatchers | ||
}); | ||
} | ||
@@ -1454,6 +1459,7 @@ function getState(expect) { | ||
} | ||
const customMatcher = (...sample) => new CustomMatcher(false, ...sample); | ||
Object.defineProperty(expect, expectAssertionName, { | ||
configurable: true, | ||
enumerable: true, | ||
value: (...sample) => new CustomMatcher(false, ...sample), | ||
value: customMatcher, | ||
writable: true | ||
@@ -1467,2 +1473,8 @@ }); | ||
}); | ||
Object.defineProperty(globalThis[ASYMMETRIC_MATCHERS_OBJECT], expectAssertionName, { | ||
configurable: true, | ||
enumerable: true, | ||
value: customMatcher, | ||
writable: true | ||
}); | ||
}); | ||
@@ -1477,2 +1489,2 @@ }; | ||
export { Any, Anything, ArrayContaining, AsymmetricMatcher, GLOBAL_EXPECT, JEST_MATCHERS_OBJECT, JestAsymmetricMatchers, JestChaiExpect, JestExtend, MATCHERS_OBJECT, ObjectContaining, StringContaining, StringMatching, arrayBufferEquality, equals, fnNameFor, generateToBeMessage, getState, hasAsymmetric, hasProperty, isA, isAsymmetric, isImmutableUnorderedKeyed, isImmutableUnorderedSet, iterableEquality, pluralize, setState, sparseArrayEquality, subsetEquality, typeEquality }; | ||
export { ASYMMETRIC_MATCHERS_OBJECT, Any, Anything, ArrayContaining, AsymmetricMatcher, GLOBAL_EXPECT, JEST_MATCHERS_OBJECT, JestAsymmetricMatchers, JestChaiExpect, JestExtend, MATCHERS_OBJECT, ObjectContaining, StringContaining, StringMatching, arrayBufferEquality, equals, fnNameFor, generateToBeMessage, getState, hasAsymmetric, hasProperty, isA, isAsymmetric, isImmutableUnorderedKeyed, isImmutableUnorderedSet, iterableEquality, pluralize, setState, sparseArrayEquality, subsetEquality, typeEquality }; |
@@ -257,2 +257,3 @@ import { stringify, Constructable } from '@vitest/utils'; | ||
declare const GLOBAL_EXPECT: unique symbol; | ||
declare const ASYMMETRIC_MATCHERS_OBJECT: unique symbol; | ||
@@ -266,2 +267,2 @@ declare function getState<State extends MatcherState = MatcherState>(expect: ExpectStatic): State; | ||
export { Any, Anything, ArrayContaining, type Assertion, AsymmetricMatcher, type AsymmetricMatcherInterface, type AsymmetricMatchersContaining, type AsyncExpectationResult, type ChaiPlugin, type ExpectStatic, type ExpectationResult, GLOBAL_EXPECT, JEST_MATCHERS_OBJECT, type JestAssertion, JestAsymmetricMatchers, JestChaiExpect, JestExtend, MATCHERS_OBJECT, type MatcherHintOptions, type MatcherState, type MatchersObject, ObjectContaining, type RawMatcherFn, StringContaining, StringMatching, type SyncExpectationResult, type Tester, arrayBufferEquality, equals, fnNameFor, generateToBeMessage, getState, hasAsymmetric, hasProperty, isA, isAsymmetric, isImmutableUnorderedKeyed, isImmutableUnorderedSet, iterableEquality, pluralize, setState, sparseArrayEquality, subsetEquality, typeEquality }; | ||
export { ASYMMETRIC_MATCHERS_OBJECT, Any, Anything, ArrayContaining, type Assertion, AsymmetricMatcher, type AsymmetricMatcherInterface, type AsymmetricMatchersContaining, type AsyncExpectationResult, type ChaiPlugin, type ExpectStatic, type ExpectationResult, GLOBAL_EXPECT, JEST_MATCHERS_OBJECT, type JestAssertion, JestAsymmetricMatchers, JestChaiExpect, JestExtend, MATCHERS_OBJECT, type MatcherHintOptions, type MatcherState, type MatchersObject, ObjectContaining, type RawMatcherFn, StringContaining, StringMatching, type SyncExpectationResult, type Tester, arrayBufferEquality, equals, fnNameFor, generateToBeMessage, getState, hasAsymmetric, hasProperty, isA, isAsymmetric, isImmutableUnorderedKeyed, isImmutableUnorderedSet, iterableEquality, pluralize, setState, sparseArrayEquality, subsetEquality, typeEquality }; |
@@ -11,2 +11,3 @@ import { getColors, stringify, isObject, assertTypes } from '@vitest/utils'; | ||
const GLOBAL_EXPECT = Symbol.for("expect-global"); | ||
const ASYMMETRIC_MATCHERS_OBJECT = Symbol.for("asymmetric-matchers-object"); | ||
@@ -16,2 +17,3 @@ if (!Object.prototype.hasOwnProperty.call(globalThis, MATCHERS_OBJECT)) { | ||
const matchers = /* @__PURE__ */ Object.create(null); | ||
const assymetricMatchers = /* @__PURE__ */ Object.create(null); | ||
Object.defineProperty(globalThis, MATCHERS_OBJECT, { | ||
@@ -27,2 +29,5 @@ get: () => globalState | ||
}); | ||
Object.defineProperty(globalThis, ASYMMETRIC_MATCHERS_OBJECT, { | ||
get: () => assymetricMatchers | ||
}); | ||
} | ||
@@ -1454,6 +1459,7 @@ function getState(expect) { | ||
} | ||
const customMatcher = (...sample) => new CustomMatcher(false, ...sample); | ||
Object.defineProperty(expect, expectAssertionName, { | ||
configurable: true, | ||
enumerable: true, | ||
value: (...sample) => new CustomMatcher(false, ...sample), | ||
value: customMatcher, | ||
writable: true | ||
@@ -1467,2 +1473,8 @@ }); | ||
}); | ||
Object.defineProperty(globalThis[ASYMMETRIC_MATCHERS_OBJECT], expectAssertionName, { | ||
configurable: true, | ||
enumerable: true, | ||
value: customMatcher, | ||
writable: true | ||
}); | ||
}); | ||
@@ -1477,2 +1489,2 @@ }; | ||
export { Any, Anything, ArrayContaining, AsymmetricMatcher, GLOBAL_EXPECT, JEST_MATCHERS_OBJECT, JestAsymmetricMatchers, JestChaiExpect, JestExtend, MATCHERS_OBJECT, ObjectContaining, StringContaining, StringMatching, arrayBufferEquality, equals, fnNameFor, generateToBeMessage, getState, hasAsymmetric, hasProperty, isA, isAsymmetric, isImmutableUnorderedKeyed, isImmutableUnorderedSet, iterableEquality, pluralize, setState, sparseArrayEquality, subsetEquality, typeEquality }; | ||
export { ASYMMETRIC_MATCHERS_OBJECT, Any, Anything, ArrayContaining, AsymmetricMatcher, GLOBAL_EXPECT, JEST_MATCHERS_OBJECT, JestAsymmetricMatchers, JestChaiExpect, JestExtend, MATCHERS_OBJECT, ObjectContaining, StringContaining, StringMatching, arrayBufferEquality, equals, fnNameFor, generateToBeMessage, getState, hasAsymmetric, hasProperty, isA, isAsymmetric, isImmutableUnorderedKeyed, isImmutableUnorderedSet, iterableEquality, pluralize, setState, sparseArrayEquality, subsetEquality, typeEquality }; |
{ | ||
"name": "@vitest/expect", | ||
"type": "module", | ||
"version": "1.0.0-beta.3", | ||
"version": "1.0.0-beta.4", | ||
"description": "Jest's expect matchers as a Chai plugin", | ||
@@ -34,4 +34,4 @@ "license": "MIT", | ||
"chai": "^4.3.10", | ||
"@vitest/utils": "1.0.0-beta.3", | ||
"@vitest/spy": "1.0.0-beta.3" | ||
"@vitest/spy": "1.0.0-beta.4", | ||
"@vitest/utils": "1.0.0-beta.4" | ||
}, | ||
@@ -42,3 +42,3 @@ "devDependencies": { | ||
"rollup-plugin-copy": "^3.5.0", | ||
"@vitest/runner": "1.0.0-beta.3" | ||
"@vitest/runner": "1.0.0-beta.4" | ||
}, | ||
@@ -45,0 +45,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
183838
3190
+ Added@vitest/spy@1.0.0-beta.4(transitive)
+ Added@vitest/utils@1.0.0-beta.4(transitive)
- Removed@vitest/spy@1.0.0-beta.3(transitive)
- Removed@vitest/utils@1.0.0-beta.3(transitive)
Updated@vitest/spy@1.0.0-beta.4
Updated@vitest/utils@1.0.0-beta.4