jest-matcher-utils
Advanced tools
Comparing version 19.0.0 to 19.1.0-alpha.eed82034
@@ -16,4 +16,7 @@ /** | ||
const AsymmetricMatcherPlugin = require('pretty-format/build/plugins/AsymmetricMatcher'); | ||
const ReactElementPlugin = require('pretty-format/build/plugins/ReactElement'); | ||
const ImmutablePlugins = require('pretty-format/build/plugins/ImmutablePlugins'); | ||
const PLUGINS = [AsymmetricMatcherPlugin]; | ||
const PLUGINS = [AsymmetricMatcherPlugin, ReactElementPlugin].concat( | ||
ImmutablePlugins); | ||
@@ -34,2 +37,3 @@ | ||
const EXPECTED_COLOR = chalk.green; | ||
@@ -118,11 +122,7 @@ const EXPECTED_BG = chalk.bgGreen; | ||
const printReceived = object => highlightTrailingWhitespace( | ||
RECEIVED_COLOR(stringify(object)), | ||
RECEIVED_BG); | ||
const printReceived = object => | ||
highlightTrailingWhitespace(RECEIVED_COLOR(stringify(object)), RECEIVED_BG); | ||
const printExpected = value => | ||
highlightTrailingWhitespace(EXPECTED_COLOR(stringify(value)), EXPECTED_BG); | ||
const printExpected = value => highlightTrailingWhitespace( | ||
EXPECTED_COLOR(stringify(value)), | ||
EXPECTED_BG); | ||
const printWithType = ( | ||
@@ -134,9 +134,6 @@ name, | ||
const type = getType(received); | ||
return ( | ||
name + ':' + ( | ||
type !== 'null' && type !== 'undefined' ? | ||
'\n ' + type + ': ' : | ||
' ') + | ||
print(received)); | ||
return name + | ||
':' + ( | ||
type !== 'null' && type !== 'undefined' ? '\n ' + type + ': ' : ' ') + | ||
print(received); | ||
}; | ||
@@ -148,3 +145,4 @@ | ||
throw new Error( | ||
matcherHint('[.not]' + matcherName, undefined, '') + '\n\n' + | ||
matcherHint('[.not]' + matcherName, undefined, '') + | ||
'\n\n' + | ||
'Matcher does not accept any arguments.\n' + | ||
@@ -160,4 +158,5 @@ printWithType('Got', expected, printExpected)); | ||
throw new Error( | ||
matcherHint('[.not]' + matcherName) + '\n\n' + | ||
`Actual value must be a number.\n` + | ||
matcherHint('[.not]' + matcherName) + | ||
'\n\n' + | ||
`Received value must be a number.\n` + | ||
printWithType('Received', actual, printReceived)); | ||
@@ -172,3 +171,4 @@ | ||
throw new Error( | ||
matcherHint('[.not]' + matcherName) + '\n\n' + | ||
matcherHint('[.not]' + matcherName) + | ||
'\n\n' + | ||
`Expected value must be a number.\n` + | ||
@@ -185,4 +185,3 @@ printWithType('Got', expected, printExpected)); | ||
const pluralize = | ||
(word, count) => | ||
const pluralize = (word, count) => | ||
(NUMBERS[count] || count) + ' ' + word + (count === 1 ? '' : 's'); | ||
@@ -201,10 +200,8 @@ | ||
const isDirectExpectCall = options && options.isDirectExpectCall; | ||
return ( | ||
chalk.dim('expect' + (isDirectExpectCall ? '' : '(')) + | ||
RECEIVED_COLOR(received) + | ||
chalk.dim((isDirectExpectCall ? '' : ')') + matcherName + '(') + | ||
EXPECTED_COLOR(expected) + ( | ||
secondArgument ? `, ${EXPECTED_COLOR(secondArgument)}` : '') + | ||
chalk.dim(')')); | ||
return chalk.dim('expect' + (isDirectExpectCall ? '' : '(')) + | ||
RECEIVED_COLOR(received) + | ||
chalk.dim((isDirectExpectCall ? '' : ')') + matcherName + '(') + | ||
EXPECTED_COLOR(expected) + ( | ||
secondArgument ? `, ${EXPECTED_COLOR(secondArgument)}` : '') + | ||
chalk.dim(')'); | ||
}; | ||
@@ -211,0 +208,0 @@ |
{ | ||
"name": "jest-matcher-utils", | ||
"description": "A set of utility functions for jest-matchers and related packages", | ||
"version": "19.0.0", | ||
"version": "19.1.0-alpha.eed82034", | ||
"repository": { | ||
@@ -13,4 +13,4 @@ "type": "git", | ||
"chalk": "^1.1.3", | ||
"pretty-format": "^19.0.0" | ||
"pretty-format": "^19.1.0-alpha.eed82034" | ||
} | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
7177
4
2
+ Addedpretty-format@19.1.0-alpha.eed82034(transitive)
- Removedpretty-format@19.0.0(transitive)