diff --git a/package.json b/package.json index 7f341cad..63bf00c3 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "babel": "^5.6.14", "babel-jest": "^5.3.0", - "jest-cli": "^0.8.0" + "jest-cli": "^0.9.0" }, "jest": { "scriptPreprocessor": "/node_modules/babel-jest", diff --git a/src/__tests__/matchNode-test.js b/src/__tests__/matchNode-test.js index 75658c9d..9305a652 100644 --- a/src/__tests__/matchNode-test.js +++ b/src/__tests__/matchNode-test.js @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -/*global jest, describe, it, expect*/ +/*global jest, describe, it, expect, beforeEach*/ jest.autoMockOff(); var matchNode = require('../matchNode'); @@ -15,9 +15,14 @@ var matchNode = require('../matchNode'); describe('matchNode', function() { beforeEach(function() { jest.addMatchers({ - toMatchNode: function(needle) { - var haystack = this.actual; - return matchNode(haystack, needle); + toMatchNode: function() { + return { + compare(haystack, needle) { + const result = {}; + result.pass = matchNode(haystack, needle); + return result; + }, + }; } }); })