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

Replace print with serialize in Immutable plugins #4189

Merged
merged 10 commits into from
Aug 6, 2017
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`lastCalledWith works with Immutable.js objects 1`] = `
"<dim>expect(<red>jest.fn()</><dim>).not.lastCalledWith(<green>expected</><dim>)

Expected mock function to not have been last called with:
<green>[Immutable.Map {a: {\\"b\\": \\"c\\"}}, Immutable.Map {a: {\\"b\\": \\"c\\"}}]</>"
<green>[Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]</>"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is breaking, but we're more consistent 👍

`;

exports[`lastCalledWith works with Map 1`] = `
Expand Down Expand Up @@ -239,7 +239,7 @@ exports[`toHaveBeenCalledWith works with Immutable.js objects 1`] = `
"<dim>expect(<red>jest.fn()</><dim>).not.toHaveBeenCalledWith(<green>expected</><dim>)

Expected mock function not to have been called with:
<green>[Immutable.Map {a: {\\"b\\": \\"c\\"}}, Immutable.Map {a: {\\"b\\": \\"c\\"}}]</>"
<green>[Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]</>"
`;

exports[`toHaveBeenCalledWith works with Map 1`] = `
Expand Down Expand Up @@ -322,7 +322,7 @@ exports[`toHaveBeenLastCalledWith works with Immutable.js objects 1`] = `
"<dim>expect(<red>jest.fn()</><dim>).not.toHaveBeenLastCalledWith(<green>expected</><dim>)

Expected mock function to not have been last called with:
<green>[Immutable.Map {a: {\\"b\\": \\"c\\"}}, Immutable.Map {a: {\\"b\\": \\"c\\"}}]</>"
<green>[Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]</>"
`;

exports[`toHaveBeenLastCalledWith works with Map 1`] = `
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-snapshot/src/__tests__/plugins.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const testPath = names => {
it('gets plugins', () => {
const {getSerializers} = require('../plugins');
const plugins = getSerializers();
expect(plugins.length).toBe(10);
expect(plugins.length).toBe(4);
});

it('adds plugins from an empty array', () => testPath([]));
Expand Down
10 changes: 5 additions & 5 deletions packages/pretty-format/src/__tests__/expect_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@

'use strict';

import type {Plugins} from 'types/PrettyFormat';
import type {OptionsReceived, Plugins} from 'types/PrettyFormat';

const diff = require('jest-diff');
const prettyFormat = require('../');

module.exports = {
getPrettyPrint: (plugins: Plugins) =>
function(received: any, expected: any, opts: any) {
function(received: any, expected: any, options?: OptionsReceived) {
const prettyFormatted = prettyFormat(
received,
Object.assign(
{
({
plugins,
},
opts,
}: OptionsReceived),
options,
),
);
const pass = prettyFormatted === expected;
Expand Down
Loading