Skip to content

Commit

Permalink
Workaround in test for eslint sort-keys rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark.Whitfeld committed Jun 27, 2017
1 parent 47e42cd commit b932948
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/jest-config/src/__tests__/normalize.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -837,22 +837,27 @@ describe('preset', () => {
});

test('merges with options and moduleNameMapper preset is overridden by options', () => {
/* eslint-disable sort-keys */
// prettier-ignore
// Object initializer not used for properties as a workaround for
// sort-keys eslint rule while specifing properties in
// non-alphabetical order for a better test
const moduleNameMapper = {};
moduleNameMapper.e = 'ee';
moduleNameMapper.b = 'bb';
moduleNameMapper.c = 'cc';
moduleNameMapper.a = 'aa';
const {options} = normalize(
{
moduleNameMapper: {e: 'ee', c: 'cc', b: 'bb', a: 'aa'},
moduleNameMapper,
preset: 'react-native',
rootDir: '/root/path/foo',
},
{},
);
/* eslint-enable sort-keys */

expect(options.moduleNameMapper).toEqual([
['e', 'ee'],
['c', 'cc'],
['b', 'bb'],
['c', 'cc'],
['a', 'aa'],
]);
});
Expand Down

0 comments on commit b932948

Please sign in to comment.