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 concat(Immutable) with Immutable as item of plugins array #4207

Merged
merged 1 commit into from
Aug 7, 2017
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion packages/jest-diff/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ const PLUGINS = [
ReactTestComponent,
ReactElement,
HTMLElement,
Immutable,
AsymmetricMatcher,
].concat(Immutable);
];
const FORMAT_OPTIONS = {
plugins: PLUGINS,
};
Expand Down
3 changes: 2 additions & 1 deletion packages/jest-matcher-utils/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ const PLUGINS = [
ReactTestComponent,
ReactElement,
HTMLElement,
Immutable,
AsymmetricMatcher,
].concat(Immutable);
];

const EXPECTED_COLOR = chalk.green;
const EXPECTED_BG = chalk.bgGreen;
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-snapshot/src/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const {
ReactTestComponent,
} = prettyFormat.plugins;

let PLUGINS = [ReactTestComponent, ReactElement, HTMLElement].concat(Immutable);
let PLUGINS = [ReactTestComponent, ReactElement, HTMLElement, Immutable];

// Prepend to list so the last added is the first tested.
exports.addSerializer = (plugin: Plugin) => {
Expand Down
9 changes: 5 additions & 4 deletions packages/pretty-format/src/__tests__/immutable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
import React from 'react';
import Immutable from 'immutable';
import prettyFormat from '../';
const {Immutable: ImmutablePlugins, ReactElement} = prettyFormat.plugins;
const {Immutable: ImmutablePlugin, ReactElement} = prettyFormat.plugins;
import expectUtil from './expect_util';

const toPrettyPrintTo = expectUtil.getPrettyPrint(
[ReactElement].concat(ImmutablePlugins),
);
const toPrettyPrintTo = expectUtil.getPrettyPrint([
ReactElement,
ImmutablePlugin,
]);

const expect = global.expect;
expect.extend({toPrettyPrintTo});
Expand Down