Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vitest/expect

Package Overview
Dependencies
Maintainers
4
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitest/expect - npm Package Compare versions

Comparing version 2.1.5 to 2.2.0-beta.1

39

dist/index.d.ts

@@ -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 @@ *

8

package.json
{
"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

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