@vitest/expect
Advanced tools
Comparing version 2.1.5 to 2.2.0-beta.1
@@ -0,1 +1,2 @@ | ||
import { MockInstance } from '@vitest/spy'; | ||
import { stringify, Constructable } from '@vitest/utils'; | ||
@@ -553,2 +554,10 @@ import * as tinyrainbow from 'tinyrainbow'; | ||
/** | ||
* Ensure that a mock function is called with specific arguments and called | ||
* exactly once. | ||
* | ||
* @example | ||
* expect(mockFunc).toHaveBeenCalledExactlyOnceWith('arg1', 42); | ||
*/ | ||
toHaveBeenCalledExactlyOnceWith: <E extends any[]>(...args: E) => void; | ||
/** | ||
* Checks that a value satisfies a custom matcher function. | ||
@@ -564,2 +573,32 @@ * | ||
/** | ||
* This assertion checks if a `Mock` was called before another `Mock`. | ||
* @param mock - A mock function created by `vi.spyOn` or `vi.fn` | ||
* @param failIfNoFirstInvocation - Fail if the first mock was never called | ||
* @example | ||
* const mock1 = vi.fn() | ||
* const mock2 = vi.fn() | ||
* | ||
* mock1() | ||
* mock2() | ||
* mock1() | ||
* | ||
* expect(mock1).toHaveBeenCalledBefore(mock2) | ||
*/ | ||
toHaveBeenCalledBefore: (mock: MockInstance, failIfNoFirstInvocation?: boolean) => void; | ||
/** | ||
* This assertion checks if a `Mock` was called after another `Mock`. | ||
* @param mock - A mock function created by `vi.spyOn` or `vi.fn` | ||
* @param failIfNoFirstInvocation - Fail if the first mock was never called | ||
* @example | ||
* const mock1 = vi.fn() | ||
* const mock2 = vi.fn() | ||
* | ||
* mock2() | ||
* mock1() | ||
* mock2() | ||
* | ||
* expect(mock1).toHaveBeenCalledAfter(mock2) | ||
*/ | ||
toHaveBeenCalledAfter: (mock: MockInstance, failIfNoFirstInvocation?: boolean) => void; | ||
/** | ||
* Checks that a promise resolves successfully at least once. | ||
@@ -566,0 +605,0 @@ * |
{ | ||
"name": "@vitest/expect", | ||
"type": "module", | ||
"version": "2.1.5", | ||
"version": "2.2.0-beta.1", | ||
"description": "Jest's expect matchers as a Chai plugin", | ||
@@ -35,4 +35,4 @@ "license": "MIT", | ||
"tinyrainbow": "^1.2.0", | ||
"@vitest/utils": "2.1.5", | ||
"@vitest/spy": "2.1.5" | ||
"@vitest/spy": "2.2.0-beta.1", | ||
"@vitest/utils": "2.2.0-beta.1" | ||
}, | ||
@@ -42,3 +42,3 @@ "devDependencies": { | ||
"rollup-plugin-copy": "^3.5.0", | ||
"@vitest/runner": "2.1.5" | ||
"@vitest/runner": "2.2.0-beta.1" | ||
}, | ||
@@ -45,0 +45,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
169516
2864
1
+ Added@vitest/pretty-format@2.2.0-beta.1(transitive)
+ Added@vitest/spy@2.2.0-beta.1(transitive)
+ Added@vitest/utils@2.2.0-beta.1(transitive)
- Removed@vitest/pretty-format@2.1.5(transitive)
- Removed@vitest/spy@2.1.5(transitive)
- Removed@vitest/utils@2.1.5(transitive)
Updated@vitest/spy@2.2.0-beta.1
Updated@vitest/utils@2.2.0-beta.1