Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Human-readable colors for jest-matchers snapshots #3119

Merged
merged 3 commits into from
Mar 10, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"private": true,
"devDependencies": {
"ansi-regex": "^2.0.0",
"ansi-styles": "^3.0.0",
"babel-core": "^6.23.1",
"babel-eslint": "^7.1.1",
"babel-plugin-syntax-trailing-function-commas": "^6.13.0",
Expand Down Expand Up @@ -84,6 +86,9 @@
"^.+\\.js$": "<rootDir>/packages/babel-jest"
},
"setupTestFrameworkScriptFile": "<rootDir>/testSetupFile.js",
"snapshotSerializers": [
"<rootDir>/packages/pretty-format/build/plugins/ConvertAnsi.js"
],
"testEnvironment": "./packages/jest-environment-node",
"testPathIgnorePatterns": [
"/node_modules/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,41 @@ exports[`Upgrade help logs a warning when \`scriptPreprocessor\` and/or \`prepro
`;

exports[`preset throws when preset not found 1`] = `
"● Validation Error:
"<red>● Validation Error:

Preset doesnt-exist not found.
Preset doesnt-exist not found.

Configuration Documentation:
Configuration Documentation:
https://facebook.github.io/jest/docs/configuration.html
"
</>"
`;

exports[`rootDir throws if the config is missing a rootDir property 1`] = `
"● Validation Error:
"<red>● Validation Error:

Configuration option rootDir must be specified.
Configuration option rootDir must be specified.

Configuration Documentation:
Configuration Documentation:
https://facebook.github.io/jest/docs/configuration.html
"
</>"
`;

exports[`testEnvironment throws on invalid environment names 1`] = `
"● Validation Error:
"<red>● Validation Error:

Test environment phantom cannot be found. Make sure the testEnvironment configuration option points to an existing node module.
Test environment phantom cannot be found. Make sure the testEnvironment configuration option points to an existing node module.

Configuration Documentation:
Configuration Documentation:
https://facebook.github.io/jest/docs/configuration.html
"
</>"
`;

exports[`testMatch throws if testRegex and testMatch are both specified 1`] = `
"● Validation Error:
"<red>● Validation Error:

Configuration options testMatch and testRegex cannot be used together.
Configuration options testMatch and testRegex cannot be used together.

Configuration Documentation:
Configuration Documentation:
https://facebook.github.io/jest/docs/configuration.html
"
</>"
`;
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`matchers proxies matchers to jest-matchers 1`] = `
"expect(received).toBe(expected)
"expect(<red>received</>).toBe(<green>expected</>)

Expected value to be (using ===):
2
<green>2</>
Received:
1"
<red>1</>"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ exports[`.stringify() reduces maxDepth if stringifying very large objects 1`] =
exports[`.stringify() reduces maxDepth if stringifying very large objects 2`] = `"{\\"a\\": 1, \\"b\\": {\\"0\\": \\"test\\", \\"1\\": \\"test\\", \\"2\\": \\"test\\", \\"3\\": \\"test\\", \\"4\\": \\"test\\", \\"5\\": \\"test\\", \\"6\\": \\"test\\", \\"7\\": \\"test\\", \\"8\\": \\"test\\", \\"9\\": \\"test\\"}}"`;

exports[`.stringify() toJSON errors when comparing two objects 1`] = `
"expect(received).toEqual(expected)
"expect(<red>received</>).toEqual(<green>expected</>)

Expected value to equal:
{\\"b\\": 1, \\"toJSON\\": [Function toJSON]}
<green>{\\"b\\": 1, \\"toJSON\\": [Function toJSON]}</>
Received:
{\\"a\\": 1, \\"toJSON\\": [Function toJSON]}
<red>{\\"a\\": 1, \\"toJSON\\": [Function toJSON]}</>

Difference:

- Expected
+ Received
<green>- Expected</>
<red>+ Received</>

 Object {
- \\"b\\": 1,
+ \\"a\\": 1,
 \\"toJSON\\": [Function toJSON],
 }"
Object {
<green>- \\"b\\": 1,</>
<red>+ \\"a\\": 1,</>
\\"toJSON\\": [Function toJSON],
}"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

exports[`is available globally 1`] = `"expected 15 to be divisible by 2"`;

exports[`is ok if there is no message specified 1`] = `"No message was specified for this matcher."`;
exports[`is ok if there is no message specified 1`] = `"<red>No message was specified for this matcher.</>"`;
Loading