expect-mocha-snapshot
Advanced tools
Comparing version 1.0.0 to 1.0.1
const jestSnapshot = require("jest-snapshot"); | ||
const expect = require("expect"); | ||
module.exports = function toMatchSnapshot(mochaContext) { | ||
module.exports = function toMatchSnapshot(mochaContext, name) { | ||
if (!mochaContext || !mochaContext.test) { | ||
@@ -23,3 +23,3 @@ throw new Error( | ||
const result = matcher(this.actual); | ||
const result = matcher(this.actual, name); | ||
snapshotState.save(); | ||
@@ -26,0 +26,0 @@ |
{ | ||
"name": "expect-mocha-snapshot", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"peerDependencies": { | ||
@@ -5,0 +5,0 @@ "expect": "1.20.x" |
@@ -17,4 +17,4 @@ # expect-mocha-snapshot | ||
describe("foo", () => { | ||
it("matches the snapshot", () => { | ||
describe("foo", function() { | ||
it("matches the snapshot", function() { | ||
expect({ foo: "bar" }).toMatchSnapshot(this); | ||
@@ -21,0 +21,0 @@ }); |
3493