New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

chai-karma-snapshot

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai-karma-snapshot - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

5

lib/index.d.ts

@@ -6,4 +6,7 @@ /// <reference types="mocha" />

interface Assertion {
matchSnapshot(lang?: string, update?: boolean): Assertion;
matchSnapshot(lang?: any, update?: boolean): Assertion;
}
interface AssertStatic {
matchSnapshot(lang?: any, update?: boolean): Assertion;
}
}

@@ -10,0 +13,0 @@ }

12

lib/index.js

@@ -39,3 +39,11 @@ "use strict";

utils.addMethod(chai.Assertion.prototype, "matchSnapshot", function (lang, update) {
utils.addMethod(chai.Assertion.prototype, "matchSnapshot", aMethodForExpect);
chai.assert.matchSnapshot = aMethodForAssert;
function aMethodForAssert(lang, update, msg) {
// This basically wraps the 'expect' version of the assertion to allow using 'assert' syntax.
return new chai.Assertion(lang, update, msg).to.matchSnapshot();
}
function aMethodForExpect(lang, update) {
var obj = serialize(chai.util.flag(this, "object"));

@@ -61,3 +69,3 @@ var path = snapshotPath(context.runnable);

}
});
}
}

@@ -64,0 +72,0 @@

{
"name": "chai-karma-snapshot",
"version": "0.6.0",
"version": "0.6.1",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "typings": "lib/index.d.ts",

@@ -127,3 +127,3 @@ # Chai Plugin for Snapshot Testing with Karma

// __tests__/index.js
import { use, expect } from "chai";
import { use, expect, assert } from "chai";
import { matchSnapshot } from "chai-karma-snapshot";

@@ -135,3 +135,6 @@ import { test } from "../src/index.js";

it("check snapshot", () => {
// 'expect' syntax:
expect(test()).to.matchSnapshot();
// 'assert' syntax:
assert.matchSnapshot(test());
});

@@ -138,0 +141,0 @@ });

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