Skip to content

Commit

Permalink
Replace concat(Immutable) with Immutable as item of plugins array (je…
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrottimark authored and cpojer committed Aug 7, 2017
1 parent 5017683 commit 192a99f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
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

0 comments on commit 192a99f

Please sign in to comment.