Skip to content

Commit f482987

Browse files
authored
Merge pull request #22 from facebook/next
Update Upstream
2 parents 241e7f4 + 7966139 commit f482987

File tree

5 files changed

+108
-3
lines changed

5 files changed

+108
-3
lines changed

Diff for: CHANGELOG.md

+50
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,53 @@
1+
## 1.1.4 (April 3, 2018)
2+
3+
#### :bug: Bug Fix
4+
5+
* `react-dev-utils`
6+
7+
* [#4250](https://github.com/facebook/create-react-app/pull/4250) Upgrade `detect-port-alt` to fix [#4189](https://github.com/facebook/create-react-app/issues/4189). ([@Timer](https://github.com/Timer))
8+
9+
#### Committers: 1
10+
- Joe Haddad ([Timer](https://github.com/Timer))
11+
12+
### Migrating from 1.1.3 to 1.1.4
13+
14+
Inside any created project that has not been ejected, run:
15+
16+
```
17+
npm install --save --save-exact [email protected]
18+
```
19+
20+
or
21+
22+
```
23+
yarn add --exact [email protected]
24+
```
25+
26+
## 1.1.3 (April 3, 2018)
27+
28+
#### :bug: Bug Fix
29+
30+
* `react-scripts`
31+
32+
* [#4247](https://github.com/facebook/create-react-app/pull/4247) Fix `environment.dispose is not a function` error caused by a Jest bug. ([@gaearon](https://github.com/gaearon))
33+
34+
#### Committers: 1
35+
- Dan Abramov ([gaearon](https://github.com/gaearon))
36+
37+
### Migrating from 1.1.2 to 1.1.3
38+
39+
Inside any created project that has not been ejected, run:
40+
41+
```
42+
npm install --save --save-exact [email protected]
43+
```
44+
45+
or
46+
47+
```
48+
yarn add --exact [email protected]
49+
```
50+
151
## 1.1.2 (April 3, 2018)
252

353
#### :bug: Bug Fix

Diff for: packages/react-dev-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"browserslist": "2.11.3",
4343
"chalk": "2.3.0",
4444
"cross-spawn": "5.1.0",
45-
"detect-port-alt": "1.1.5",
45+
"detect-port-alt": "1.1.6",
4646
"escape-string-regexp": "1.0.5",
4747
"filesize": "3.5.11",
4848
"find-pkg": "1.0.0",

Diff for: packages/react-scripts/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"promise": "8.0.1",
5757
"raf": "3.4.0",
5858
"react-dev-utils": "^5.0.0",
59+
"resolve": "1.6.0",
5960
"style-loader": "0.19.1",
6061
"svgr": "1.8.1",
6162
"sw-precache-webpack-plugin": "0.11.4",

Diff for: packages/react-scripts/scripts/test.js

+55-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if (process.env.SKIP_PREFLIGHT_CHECK !== 'true') {
3131
// @remove-on-eject-end
3232

3333
const jest = require('jest');
34-
const argv = process.argv.slice(2);
34+
let argv = process.argv.slice(2);
3535

3636
// Watch unless on CI, in coverage mode, or explicitly running all tests
3737
if (
@@ -57,5 +57,59 @@ argv.push(
5757
)
5858
)
5959
);
60+
61+
// This is a very dirty workaround for https://github.com/facebook/jest/issues/5913.
62+
// We're trying to resolve the environment ourselves because Jest does it incorrectly.
63+
// TODO: remove this (and the `resolve` dependency) as soon as it's fixed in Jest.
64+
const resolve = require('resolve');
65+
function resolveJestDefaultEnvironment(name) {
66+
const jestDir = path.dirname(
67+
resolve.sync('jest', {
68+
basedir: __dirname,
69+
})
70+
);
71+
const jestCLIDir = path.dirname(
72+
resolve.sync('jest-cli', {
73+
basedir: jestDir,
74+
})
75+
);
76+
const jestConfigDir = path.dirname(
77+
resolve.sync('jest-config', {
78+
basedir: jestCLIDir,
79+
})
80+
);
81+
return resolve.sync(name, {
82+
basedir: jestConfigDir,
83+
});
84+
}
85+
let cleanArgv = [];
86+
let env = 'node';
87+
let next;
88+
do {
89+
next = argv.shift();
90+
if (next === '--env') {
91+
env = argv.shift();
92+
} else if (next.indexOf('--env=') === 0) {
93+
env = next.substring('--env='.length);
94+
} else {
95+
cleanArgv.push(next);
96+
}
97+
} while (argv.length > 0);
98+
argv = cleanArgv;
99+
let resolvedEnv;
100+
try {
101+
resolvedEnv = resolveJestDefaultEnvironment(`jest-environment-${env}`);
102+
} catch (e) {
103+
// ignore
104+
}
105+
if (!resolvedEnv) {
106+
try {
107+
resolvedEnv = resolveJestDefaultEnvironment(env);
108+
} catch (e) {
109+
// ignore
110+
}
111+
}
112+
const testEnvironment = resolvedEnv || env;
113+
argv.push('--env', testEnvironment);
60114
// @remove-on-eject-end
61115
jest.run(argv);

Diff for: packages/react-scripts/template/src/serviceWorker.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function register(config) {
3333
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
3434

3535
if (isLocalhost) {
36-
// This is running on localhost. Lets check if a service worker still exists or not.
36+
// This is running on localhost. Let's check if a service worker still exists or not.
3737
checkValidServiceWorker(swUrl, config);
3838

3939
// Add some additional logging to localhost, pointing developers to the

0 commit comments

Comments
 (0)