Skip to content

Commit 884321d

Browse files
aicpojer
authored andcommitted
Fix unofficial Node.js 4 support (#5134)
1 parent e74fbff commit 884321d

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

packages/jest-config/src/normalize.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,10 @@ const buildTestPathPattern = (argv: Argv): string => {
282282
const patterns = [];
283283

284284
if (argv._) {
285-
patterns.push(...argv._);
285+
patterns.push.apply(patterns, argv._);
286286
}
287287
if (argv.testPathPattern) {
288-
patterns.push(...argv.testPathPattern);
288+
patterns.push.apply(patterns, argv.testPathPattern);
289289
}
290290

291291
const testPathPattern = patterns.map(replacePathSepForRegex).join('|');

packages/jest-editor-support/src/Runner.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ export default class Runner extends EventEmitter {
9999

100100
runJestWithUpdateForSnapshots(completion: any, args: string[]) {
101101
const defaultArgs = ['--updateSnapshot'];
102-
const updateProcess = this._createProcess(this.workspace, [
103-
...defaultArgs,
104-
...(args ? args : []),
105-
]);
102+
const updateProcess = this._createProcess(
103+
this.workspace,
104+
[].concat(defaultArgs).concat(args ? args : []),
105+
);
106106
updateProcess.on('close', () => {
107107
completion();
108108
});

packages/jest-resolve/src/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,15 @@ class Resolver {
119119
const defaultPlatform = this._options.defaultPlatform;
120120
const extensions = this._options.extensions.slice();
121121
if (this._supportsNativePlatform()) {
122-
extensions.unshift(
123-
...this._options.extensions.map(ext => '.' + NATIVE_PLATFORM + ext),
122+
extensions.unshift.apply(
123+
extensions,
124+
this._options.extensions.map(ext => '.' + NATIVE_PLATFORM + ext),
124125
);
125126
}
126127
if (defaultPlatform) {
127-
extensions.unshift(
128-
...this._options.extensions.map(ext => '.' + defaultPlatform + ext),
128+
extensions.unshift.apply(
129+
extensions,
130+
this._options.extensions.map(ext => '.' + defaultPlatform + ext),
129131
);
130132
}
131133

0 commit comments

Comments
 (0)