Skip to content

Commit

Permalink
Fix unofficial Node.js 4 support (#5134)
Browse files Browse the repository at this point in the history
  • Loading branch information
ai authored and cpojer committed Dec 19, 2017
1 parent e74fbff commit 884321d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/jest-config/src/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,10 @@ const buildTestPathPattern = (argv: Argv): string => {
const patterns = [];

if (argv._) {
patterns.push(...argv._);
patterns.push.apply(patterns, argv._);
}
if (argv.testPathPattern) {
patterns.push(...argv.testPathPattern);
patterns.push.apply(patterns, argv.testPathPattern);
}

const testPathPattern = patterns.map(replacePathSepForRegex).join('|');
Expand Down
8 changes: 4 additions & 4 deletions packages/jest-editor-support/src/Runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ export default class Runner extends EventEmitter {

runJestWithUpdateForSnapshots(completion: any, args: string[]) {
const defaultArgs = ['--updateSnapshot'];
const updateProcess = this._createProcess(this.workspace, [
...defaultArgs,
...(args ? args : []),
]);
const updateProcess = this._createProcess(
this.workspace,
[].concat(defaultArgs).concat(args ? args : []),
);
updateProcess.on('close', () => {
completion();
});
Expand Down
10 changes: 6 additions & 4 deletions packages/jest-resolve/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,15 @@ class Resolver {
const defaultPlatform = this._options.defaultPlatform;
const extensions = this._options.extensions.slice();
if (this._supportsNativePlatform()) {
extensions.unshift(
...this._options.extensions.map(ext => '.' + NATIVE_PLATFORM + ext),
extensions.unshift.apply(
extensions,
this._options.extensions.map(ext => '.' + NATIVE_PLATFORM + ext),
);
}
if (defaultPlatform) {
extensions.unshift(
...this._options.extensions.map(ext => '.' + defaultPlatform + ext),
extensions.unshift.apply(
extensions,
this._options.extensions.map(ext => '.' + defaultPlatform + ext),
);
}

Expand Down

0 comments on commit 884321d

Please sign in to comment.