jest-circus
Advanced tools
Comparing version 21.0.0-alpha.2 to 21.0.0-beta.1
@@ -1,10 +0,2 @@ | ||
'use strict'; /** | ||
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* | ||
*/var _require = | ||
'use strict'; | ||
@@ -14,5 +6,2 @@ | ||
require('jest-matcher-utils');const printReceived = _require.printReceived,printExpected = _require.printExpected; | ||
const chalk = require('chalk'); | ||
const diff = require('jest-diff'); | ||
@@ -26,5 +15,16 @@ | ||
var _jestMatcherUtils = require('jest-matcher-utils'); | ||
var _chalk = require('chalk');var _chalk2 = _interopRequireDefault(_chalk); | ||
var _jestDiff = require('jest-diff');var _jestDiff2 = _interopRequireDefault(_jestDiff);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} | ||
const assertOperatorsMap = { | ||
@@ -34,12 +34,12 @@ '!=': 'notEqual', | ||
'==': 'equal', | ||
'===': 'strictEqual' }; | ||
'===': 'strictEqual' }; /** | ||
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* | ||
*/const humanReadableOperators = { deepEqual: 'to deeply equal', deepStrictEqual: 'to deeply and strictly equal', notDeepEqual: 'not to deeply equal', notDeepStrictEqual: 'not to deeply and strictly equal' }; | ||
const humanReadableOperators = { | ||
deepEqual: 'to deeply equal', | ||
deepStrictEqual: 'to deeply and strictly equal', | ||
notDeepEqual: 'not to deeply equal', | ||
notDeepStrictEqual: 'not to deeply and strictly equal' }; | ||
module.exports = (event, state) => { | ||
@@ -81,6 +81,6 @@ switch (event.name) { | ||
return ( | ||
chalk.dim('assert') + | ||
chalk.dim('.' + operatorName + '(') + | ||
chalk.red('function') + | ||
chalk.dim(')')); | ||
_chalk2.default.dim('assert') + | ||
_chalk2.default.dim('.' + operatorName + '(') + | ||
_chalk2.default.red('function') + | ||
_chalk2.default.dim(')')); | ||
@@ -91,8 +91,8 @@ }; | ||
let message = | ||
chalk.dim('assert') + | ||
chalk.dim('.' + operatorName + '(') + | ||
chalk.red('received') + | ||
chalk.dim(', ') + | ||
chalk.green('expected') + | ||
chalk.dim(')'); | ||
_chalk2.default.dim('assert') + | ||
_chalk2.default.dim('.' + operatorName + '(') + | ||
_chalk2.default.red('received') + | ||
_chalk2.default.dim(', ') + | ||
_chalk2.default.green('expected') + | ||
_chalk2.default.dim(')'); | ||
@@ -102,6 +102,6 @@ if (operator === '==') { | ||
' or ' + | ||
chalk.dim('assert') + | ||
chalk.dim('(') + | ||
chalk.red('received') + | ||
chalk.dim(') '); | ||
_chalk2.default.dim('assert') + | ||
_chalk2.default.dim('(') + | ||
_chalk2.default.red('received') + | ||
_chalk2.default.dim(') '); | ||
} | ||
@@ -114,3 +114,3 @@ | ||
expected = error.expected,actual = error.actual,message = error.message,operator = error.operator,stack = error.stack; | ||
const diffString = diff(expected, actual, options); | ||
const diffString = (0, _jestDiff2.default)(expected, actual, options); | ||
const negator = | ||
@@ -126,6 +126,6 @@ typeof operator === 'string' && ( | ||
'\n\n' + | ||
chalk.reset(`Expected the function not to throw an error.\n`) + | ||
chalk.reset(`Instead, it threw:\n`) + | ||
` ${printReceived(actual)}` + | ||
chalk.reset(hasCustomMessage ? '\n\nMessage:\n ' + message : '') + | ||
_chalk2.default.reset(`Expected the function not to throw an error.\n`) + | ||
_chalk2.default.reset(`Instead, it threw:\n`) + | ||
` ${(0, _jestMatcherUtils.printReceived)(actual)}` + | ||
_chalk2.default.reset(hasCustomMessage ? '\n\nMessage:\n ' + message : '') + | ||
stack.replace(/AssertionError(.*)/g, '')); | ||
@@ -139,5 +139,5 @@ | ||
'\n\n' + | ||
chalk.reset(`Expected the function to throw an error.\n`) + | ||
chalk.reset(`But it didn't throw anything.`) + | ||
chalk.reset(hasCustomMessage ? '\n\nMessage:\n ' + message : '') + | ||
_chalk2.default.reset(`Expected the function to throw an error.\n`) + | ||
_chalk2.default.reset(`But it didn't throw anything.`) + | ||
_chalk2.default.reset(hasCustomMessage ? '\n\nMessage:\n ' + message : '') + | ||
stack.replace(/AssertionError(.*)/g, '')); | ||
@@ -150,7 +150,7 @@ | ||
'\n\n' + | ||
chalk.reset(`Expected value ${operatorMessage(operator, negator)}`) + | ||
` ${printExpected(expected)}\n` + | ||
chalk.reset(`Received:\n`) + | ||
` ${printReceived(actual)}` + | ||
chalk.reset(hasCustomMessage ? '\n\nMessage:\n ' + message : '') + ( | ||
_chalk2.default.reset(`Expected value ${operatorMessage(operator, negator)}`) + | ||
` ${(0, _jestMatcherUtils.printExpected)(expected)}\n` + | ||
_chalk2.default.reset(`Received:\n`) + | ||
` ${(0, _jestMatcherUtils.printReceived)(actual)}` + | ||
_chalk2.default.reset(hasCustomMessage ? '\n\nMessage:\n ' + message : '') + ( | ||
diffString ? `\n\nDifference:\n\n${diffString}` : '') + | ||
@@ -157,0 +157,0 @@ stack.replace(/AssertionError(.*)/g, '')); |
@@ -15,7 +15,3 @@ 'use strict'; | ||
var _jestMatchers = require('jest-matchers'); | ||
var _expect = require('expect'); | ||
var _jestMessageUtil = require('jest-message-util'); | ||
@@ -57,3 +53,3 @@ var _jestSnapshot = require('jest-snapshot'); | ||
const snapshotState = new _jestSnapshot.SnapshotState(testPath, { expand, updateSnapshot }); | ||
(0, _jestMatchers.setState)({ snapshotState, testPath }); | ||
(0, _expect.setState)({ snapshotState, testPath }); | ||
@@ -160,3 +156,3 @@ // Return it back to the outer scope (test runner outside the VM). | ||
case 'test_start':{ | ||
(0, _jestMatchers.setState)({ currentTestName: (0, _utils.getTestID)(event.test) }); | ||
(0, _expect.setState)({ currentTestName: (0, _utils.getTestID)(event.test) }); | ||
break; | ||
@@ -174,3 +170,3 @@ } | ||
const _addExpectedAssertionErrors = test => { | ||
const failures = (0, _jestMatchers.extractExpectedAssertionsErrors)(); | ||
const failures = (0, _expect.extractExpectedAssertionsErrors)(); | ||
const errors = failures.map(failure => failure.error); | ||
@@ -184,4 +180,4 @@ test.errors = test.errors.concat(errors); | ||
const _addSuppressedErrors = test => {var _getState = | ||
(0, _jestMatchers.getState)();const suppressedErrors = _getState.suppressedErrors; | ||
(0, _jestMatchers.setState)({ suppressedErrors: [] }); | ||
(0, _expect.getState)();const suppressedErrors = _getState.suppressedErrors; | ||
(0, _expect.setState)({ suppressedErrors: [] }); | ||
if (suppressedErrors.length) { | ||
@@ -188,0 +184,0 @@ test.status = 'fail'; |
@@ -13,3 +13,3 @@ 'use strict'; | ||
var _jestMatchers = require('jest-matchers');var _jestMatchers2 = _interopRequireDefault(_jestMatchers); | ||
var _expect = require('expect');var _expect2 = _interopRequireDefault(_expect); | ||
@@ -29,8 +29,8 @@ var _jestSnapshot = require('jest-snapshot');function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} | ||
module.exports = config => { | ||
global.expect = _jestMatchers2.default; | ||
_jestMatchers2.default.setState({ | ||
global.expect = _expect2.default; | ||
_expect2.default.setState({ | ||
expand: config.expand }); | ||
_jestMatchers2.default.extend({ toMatchSnapshot: _jestSnapshot.toMatchSnapshot, toThrowErrorMatchingSnapshot: _jestSnapshot.toThrowErrorMatchingSnapshot }); | ||
_jestMatchers2.default.addSnapshotSerializer = _jestSnapshot.addSerializer; | ||
_expect2.default.extend({ toMatchSnapshot: _jestSnapshot.toMatchSnapshot, toThrowErrorMatchingSnapshot: _jestSnapshot.toThrowErrorMatchingSnapshot }); | ||
_expect2.default.addSnapshotSerializer = _jestSnapshot.addSerializer; | ||
}; /** | ||
@@ -37,0 +37,0 @@ * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
{ | ||
"name": "jest-circus", | ||
"version": "21.0.0-alpha.2", | ||
"version": "21.0.0-beta.1", | ||
"repository": { | ||
@@ -12,11 +12,11 @@ "type": "git", | ||
"chalk": "^2.0.1", | ||
"jest-diff": "21.0.0-alpha.2", | ||
"jest-matcher-utils": "21.0.0-alpha.2", | ||
"jest-matchers": "21.0.0-alpha.2", | ||
"jest-message-util": "21.0.0-alpha.2", | ||
"jest-snapshot": "21.0.0-alpha.2" | ||
"expect": "21.0.0-beta.1", | ||
"jest-diff": "21.0.0-beta.1", | ||
"jest-matcher-utils": "21.0.0-beta.1", | ||
"jest-message-util": "21.0.0-beta.1", | ||
"jest-snapshot": "21.0.0-beta.1" | ||
}, | ||
"devDependencies": { | ||
"jest-runtime": "21.0.0-alpha.2" | ||
"jest-runtime": "21.0.0-beta.1" | ||
} | ||
} |
@@ -14,5 +14,5 @@ /** | ||
const {printReceived, printExpected} = require('jest-matcher-utils'); | ||
const chalk = require('chalk'); | ||
const diff = require('jest-diff'); | ||
import {printExpected, printReceived} from 'jest-matcher-utils'; | ||
import chalk from 'chalk'; | ||
import diff from 'jest-diff'; | ||
@@ -19,0 +19,0 @@ type AssertionError = {| |
@@ -15,7 +15,3 @@ /** | ||
import { | ||
extractExpectedAssertionsErrors, | ||
getState, | ||
setState, | ||
} from 'jest-matchers'; | ||
import {extractExpectedAssertionsErrors, getState, setState} from 'expect'; | ||
import {formatResultsErrors} from 'jest-message-util'; | ||
@@ -22,0 +18,0 @@ import {SnapshotState, addSerializer} from 'jest-snapshot'; |
@@ -13,3 +13,3 @@ /** | ||
import expect from 'jest-matchers'; | ||
import expect from 'expect'; | ||
@@ -16,0 +16,0 @@ import { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73438
1633
+ Addedexpect@21.0.0-beta.1
+ Addedexpect@21.0.0-beta.1(transitive)
+ Addedjest-diff@21.0.0-beta.1(transitive)
+ Addedjest-get-type@21.0.0-beta.1(transitive)
+ Addedjest-matcher-utils@21.0.0-beta.1(transitive)
+ Addedjest-message-util@21.0.0-beta.1(transitive)
+ Addedjest-regex-util@21.0.0-beta.1(transitive)
+ Addedjest-snapshot@21.0.0-beta.1(transitive)
+ Addedpretty-format@21.0.0-beta.1(transitive)
- Removedjest-matchers@21.0.0-alpha.2
- Removedcallsites@2.0.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedjest-diff@21.0.0-alpha.2(transitive)
- Removedjest-get-type@21.0.0-alpha.2(transitive)
- Removedjest-matcher-utils@21.0.0-alpha.2(transitive)
- Removedjest-matchers@21.0.0-alpha.2(transitive)
- Removedjest-message-util@21.0.0-alpha.2(transitive)
- Removedjest-mock@21.0.0-alpha.2(transitive)
- Removedjest-regex-util@21.0.0-alpha.2(transitive)
- Removedjest-snapshot@21.0.0-alpha.2(transitive)
- Removedjest-util@21.0.0-alpha.2(transitive)
- Removedjest-validate@21.0.0-alpha.2(transitive)
- Removedleven@2.1.0(transitive)
- Removedpretty-format@21.0.0-alpha.2(transitive)
Updatedjest-diff@21.0.0-beta.1
Updatedjest-snapshot@21.0.0-beta.1