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

@cypress/sinon-chai

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cypress/sinon-chai - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

31

lib/sinon-chai.js

@@ -24,2 +24,5 @@ (function (sinonChai) {

var callsSuffix = "\n\n The following calls were made:\n%C";
var noCallsSuffix = ", but it was never called";
function isSpy(putativeSpy) {

@@ -52,2 +55,3 @@ return typeof putativeSpy === "function" &&

failedSuffix = failedSuffix || "";
if (isSpy(spy.proxy)) {

@@ -57,2 +61,11 @@ spy = spy.proxy;

if (spy.getCalls().length) {
// if there were calls, display them in case of a failure
failedSuffix += callsSuffix;
} else {
// otherwise, replace the entire failed suffix with message that
// there were no calls
failedSuffix = noCallsSuffix;
}
function printfArray(array) {

@@ -131,9 +144,7 @@ return spy.printf.apply(spy, array);

var calls = "\n\n The following calls were made:\n%C";
sinonProperty("called", "been called", " at least once", " at least once, but it was never called");
sinonPropertyAsBooleanMethod("callCount", "been called exactly %1", "", ", but it was called %c" + calls);
sinonProperty("calledOnce", "been called exactly once", "", ", but it was called %c" + calls);
sinonProperty("calledTwice", "been called exactly twice", "", ", but it was called %c" + calls);
sinonProperty("calledThrice", "been called exactly thrice", "", ", but it was called %c" + calls);
sinonProperty("called", "been called at least once");
sinonPropertyAsBooleanMethod("callCount", "been called exactly %1", "", ", but it was called %c");
sinonProperty("calledOnce", "been called exactly once", "", ", but it was called %c");
sinonProperty("calledTwice", "been called exactly twice", "", ", but it was called %c");
sinonProperty("calledThrice", "been called exactly thrice", "", ", but it was called %c");
sinonMethodAsProperty("calledWithNew", "been called with new");

@@ -143,7 +154,7 @@ sinonMethod("calledBefore", "been called before %1");

sinonMethod("calledOn", "been called with %1 as this", "", ", but it was called with %t instead");
sinonMethod("calledWith", "been called with arguments %*", "", calls);
sinonMethod("calledWithExactly", "been called with exact arguments %*", "", calls);
sinonMethod("calledWithMatch", "been called with arguments matching %*", "", calls);
sinonMethod("calledWith", "been called with arguments %*");
sinonMethod("calledWithExactly", "been called with exact arguments %*");
sinonMethod("calledWithMatch", "been called with arguments matching %*");
sinonMethod("returned", "returned %1");
exceptionalSinonMethod("thrown", "threw", "thrown %1");
}));

@@ -16,3 +16,3 @@ {

],
"version": "1.0.0",
"version": "1.0.1",
"author": "Domenic Denicola <d@domenic.me> (https://domenic.me/)",

@@ -61,3 +61,5 @@ "license": "(BSD-2-Clause OR WTFPL)",

"commit-msg": "simple",
"pre-commit": [],
"pre-commit": [
"npm test"
],
"pre-push": [],

@@ -64,0 +66,0 @@ "post-commit": [],

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