jest-jasmine2
Advanced tools
Comparing version 13.3.0-alpha.4eb0c908 to 13.3.0-alpha.8b48d59e
@@ -19,6 +19,6 @@ /** | ||
const expect = require('jest-matchers').expect; | ||
const fs = require('graceful-fs'); | ||
const jasminePit = require('./jasmine-pit'); | ||
const snapshot = require('jest-snapshot'); | ||
const fs = require('graceful-fs'); | ||
const path = require('path'); | ||
const vm = require('vm'); | ||
@@ -297,14 +297,11 @@ | ||
// extend jasmine matchers with `jest-matchers` | ||
const jasmineExpect = env.expect; | ||
env.expect = actual => { | ||
const jasmineMatchers = jasmineExpect(actual); | ||
const jestMatchers = expect(actual); | ||
const not = Object.assign(jasmineMatchers.not, jestMatchers.not); | ||
return Object.assign(jasmineMatchers, jestMatchers, { not });}; | ||
const snapshotState = snapshot.getSnapshotState(jasmine, testPath); | ||
env.addReporter(reporter); | ||
const snapshotState = snapshot.getSnapshotState(jasmine, testPath); | ||
// `jest-matchers` should be required inside test environment (vm). | ||
// Otherwise if they throw, the `Error` class will differ from the `Error` | ||
// class of the test and `error instanceof Error` will return `false`. | ||
runtime.requireModule(path.resolve(__dirname, './extendJasmineExpect.js')); | ||
env.addReporter(reporter); | ||
runtime.requireModule(testPath); | ||
@@ -311,0 +308,0 @@ env.execute(); |
{ | ||
"name": "jest-jasmine2", | ||
"version": "13.3.0-alpha.4eb0c908", | ||
"version": "13.3.0-alpha.8b48d59e", | ||
"repository": { | ||
@@ -13,5 +13,5 @@ "type": "git", | ||
"jasmine-check": "^0.1.4", | ||
"jest-matchers": "^13.3.0-alpha.4eb0c908", | ||
"jest-snapshot": "^13.3.0-alpha.4eb0c908", | ||
"jest-util": "^13.3.0-alpha.4eb0c908" | ||
"jest-matchers": "^13.3.0-alpha.8b48d59e", | ||
"jest-snapshot": "^13.3.0-alpha.8b48d59e", | ||
"jest-util": "^13.3.0-alpha.8b48d59e" | ||
}, | ||
@@ -18,0 +18,0 @@ "jest": { |
108439
8
3211