Skip to content

Commit 750f98a

Browse files
[core] Use Chrome Headless for the tests over PhantomJS
1 parent 88c0ff8 commit 750f98a

File tree

3 files changed

+51
-81
lines changed

3 files changed

+51
-81
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,12 @@
109109
"gm": "^1.23.0",
110110
"isomorphic-fetch": "^2.2.1",
111111
"jsdom": "^11.3.0",
112-
"json-loader": "^0.5.7",
113112
"jss-rtl": "^0.2.1",
114113
"karma": "^2.0.0",
115114
"karma-browserstack-launcher": "^1.3.0",
115+
"karma-chrome-launcher": "^2.2.0",
116116
"karma-mocha": "^1.3.0",
117117
"karma-mocha-reporter": "^2.2.5",
118-
"karma-phantomjs-launcher": "^1.0.4",
119118
"karma-sourcemap-loader": "^0.3.7",
120119
"karma-webpack": "^3.0.0",
121120
"lz-string": "^1.4.4",
@@ -124,6 +123,7 @@
124123
"nyc": "^12.0.1",
125124
"postcss": "^6.0.16",
126125
"prettier": "^1.8.2",
126+
"puppeteer": "^1.5.0",
127127
"raw-loader": "^0.5.1",
128128
"react": "^16.4.0",
129129
"react-autosuggest": "^9.3.2",
@@ -149,7 +149,7 @@
149149
"rollup-plugin-node-resolve": "^3.3.0",
150150
"rollup-plugin-size-snapshot": "^0.5.1",
151151
"rollup-plugin-uglify": "^4.0.0",
152-
"sinon": "^5.0.0",
152+
"sinon": "^6.0.0",
153153
"size-limit": "^0.18.0",
154154
"typescript": "^2.6.1",
155155
"url-loader": "^1.0.1",

test/karma.conf.js

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,19 @@ const browserStack = {
88
build: `material-ui-${new Date().toISOString()}`,
99
};
1010

11+
process.env.CHROME_BIN = require('puppeteer').executablePath();
12+
1113
// Karma configuration
1214
module.exports = function setKarmaConfig(config) {
1315
const baseConfig = {
1416
basePath: '../',
15-
// phantomjs is no longer maintained, we should switch to chrome headless.
16-
browsers: ['PhantomJS_Sized'],
17-
// to avoid DISCONNECTED messages on travis
17+
browsers: ['ChromeHeadless'],
1818
browserDisconnectTimeout: 120000, // default 2000
1919
browserDisconnectTolerance: 1, // default 0
2020
browserNoActivityTimeout: 300000, // default 10000
2121
colors: true,
2222
frameworks: ['mocha'],
2323
files: [
24-
'node_modules/babel-polyfill/dist/polyfill.js',
2524
{
2625
pattern: 'test/karma.tests.js',
2726
watched: true,
@@ -30,7 +29,7 @@ module.exports = function setKarmaConfig(config) {
3029
},
3130
],
3231
plugins: [
33-
'karma-phantomjs-launcher',
32+
'karma-chrome-launcher',
3433
'karma-mocha',
3534
'karma-sourcemap-loader',
3635
'karma-webpack',
@@ -65,13 +64,6 @@ module.exports = function setKarmaConfig(config) {
6564
test: /\.js$/,
6665
loader: 'babel-loader',
6766
exclude: /node_modules/,
68-
query: {
69-
cacheDirectory: true,
70-
},
71-
},
72-
{
73-
test: /\.json$/,
74-
loader: 'json-loader',
7567
},
7668
],
7769
},
@@ -83,18 +75,6 @@ module.exports = function setKarmaConfig(config) {
8375
webpackServer: {
8476
noInfo: true,
8577
},
86-
customLaunchers: {
87-
PhantomJS_Sized: {
88-
base: 'PhantomJS',
89-
options: {
90-
viewportSize: {
91-
// Matches jsdom size.
92-
width: 1024,
93-
height: 768,
94-
},
95-
},
96-
},
97-
},
9878
};
9979

10080
let newConfig = baseConfig;

yarn.lock

Lines changed: 44 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4589,7 +4589,7 @@ extglob@^2.0.4:
45894589
snapdragon "^0.8.1"
45904590
to-regex "^3.0.1"
45914591

4592-
extract-zip@^1.6.5:
4592+
extract-zip@^1.6.6:
45934593
version "1.6.7"
45944594
resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.7.tgz#a840b4b8af6403264c8db57f4f1a74333ef81fe9"
45954595
dependencies:
@@ -4918,6 +4918,12 @@ from2@^2.1.0:
49184918
inherits "^2.0.1"
49194919
readable-stream "^2.0.0"
49204920

4921+
fs-access@^1.0.0:
4922+
version "1.0.1"
4923+
resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a"
4924+
dependencies:
4925+
null-check "^1.0.0"
4926+
49214927
fs-extra@^1.0.0:
49224928
version "1.0.0"
49234929
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-1.0.0.tgz#cd3ce5f7e7cb6145883fcae3191e9877f8587950"
@@ -5401,13 +5407,6 @@ hash.js@^1.0.0, hash.js@^1.0.3:
54015407
inherits "^2.0.3"
54025408
minimalistic-assert "^1.0.0"
54035409

5404-
hasha@^2.2.0:
5405-
version "2.2.0"
5406-
resolved "https://registry.yarnpkg.com/hasha/-/hasha-2.2.0.tgz#78d7cbfc1e6d66303fe79837365984517b2f6ee1"
5407-
dependencies:
5408-
is-stream "^1.0.1"
5409-
pinkie-promise "^2.0.0"
5410-
54115410
hawk@~3.1.3:
54125411
version "3.1.3"
54135412
resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4"
@@ -6301,7 +6300,7 @@ jsesc@~0.5.0:
63016300
version "0.5.0"
63026301
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
63036302

6304-
json-loader@^0.5.4, json-loader@^0.5.7:
6303+
json-loader@^0.5.4:
63056304
version "0.5.7"
63066305
resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d"
63076306

@@ -6461,6 +6460,13 @@ karma-browserstack-launcher@^1.3.0:
64616460
browserstacktunnel-wrapper "~2.0.1"
64626461
q "~1.5.0"
64636462

6463+
karma-chrome-launcher@^2.2.0:
6464+
version "2.2.0"
6465+
resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz#cf1b9d07136cc18fe239327d24654c3dbc368acf"
6466+
dependencies:
6467+
fs-access "^1.0.0"
6468+
which "^1.2.1"
6469+
64646470
karma-mocha-reporter@^2.2.5:
64656471
version "2.2.5"
64666472
resolved "https://registry.yarnpkg.com/karma-mocha-reporter/-/karma-mocha-reporter-2.2.5.tgz#15120095e8ed819186e47a0b012f3cd741895560"
@@ -6475,13 +6481,6 @@ karma-mocha@^1.3.0:
64756481
dependencies:
64766482
minimist "1.2.0"
64776483

6478-
karma-phantomjs-launcher@^1.0.4:
6479-
version "1.0.4"
6480-
resolved "https://registry.yarnpkg.com/karma-phantomjs-launcher/-/karma-phantomjs-launcher-1.0.4.tgz#d23ca34801bda9863ad318e3bb4bd4062b13acd2"
6481-
dependencies:
6482-
lodash "^4.0.1"
6483-
phantomjs-prebuilt "^2.1.7"
6484-
64856484
karma-sourcemap-loader@^0.3.7:
64866485
version "0.3.7"
64876486
resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz#91322c77f8f13d46fed062b042e1009d4c4505d8"
@@ -6531,10 +6530,6 @@ karma@^2.0.0:
65316530
tmp "0.0.33"
65326531
useragent "2.2.1"
65336532

6534-
kew@^0.7.0:
6535-
version "0.7.0"
6536-
resolved "https://registry.yarnpkg.com/kew/-/kew-0.7.0.tgz#79d93d2d33363d6fdd2970b335d9141ad591d79b"
6537-
65386533
keycode@^2.1.7, keycode@^2.1.9:
65396534
version "2.2.0"
65406535
resolved "https://registry.yarnpkg.com/keycode/-/keycode-2.2.0.tgz#3d0af56dc7b8b8e5cba8d0a97f107204eec22b04"
@@ -6727,7 +6722,7 @@ lodash.uniq@^4.5.0:
67276722
version "4.5.0"
67286723
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
67296724

6730-
lodash@^4.0.0, lodash@^4.0.1, lodash@^4.13.1, lodash@^4.14.2, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.0, lodash@^4.5.1:
6725+
lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.2, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.0, lodash@^4.5.1:
67316726
version "4.17.10"
67326727
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
67336728

@@ -7530,6 +7525,10 @@ nth-check@~1.0.1:
75307525
dependencies:
75317526
boolbase "~1.0.0"
75327527

7528+
null-check@^1.0.0:
7529+
version "1.0.0"
7530+
resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd"
7531+
75337532
num2fraction@^1.2.2:
75347533
version "1.2.2"
75357534
resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede"
@@ -8004,20 +8003,6 @@ performance-now@^2.1.0:
80048003
version "2.1.0"
80058004
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
80068005

8007-
phantomjs-prebuilt@^2.1.7:
8008-
version "2.1.16"
8009-
resolved "https://registry.yarnpkg.com/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz#efd212a4a3966d3647684ea8ba788549be2aefef"
8010-
dependencies:
8011-
es6-promise "^4.0.3"
8012-
extract-zip "^1.6.5"
8013-
fs-extra "^1.0.0"
8014-
hasha "^2.2.0"
8015-
kew "^0.7.0"
8016-
progress "^1.1.8"
8017-
request "^2.81.0"
8018-
request-progress "^2.0.1"
8019-
which "^1.2.10"
8020-
80218006
pify@^2.0.0, pify@^2.3.0:
80228007
version "2.3.0"
80238008
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
@@ -8397,10 +8382,6 @@ process@~0.5.1:
83978382
version "0.5.2"
83988383
resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf"
83998384

8400-
progress@^1.1.8:
8401-
version "1.1.8"
8402-
resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
8403-
84048385
progress@^2.0.0:
84058386
version "2.0.0"
84068387
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"
@@ -8525,6 +8506,19 @@ [email protected], punycode@^2.1.0:
85258506
version "2.1.1"
85268507
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
85278508

8509+
puppeteer@^1.5.0:
8510+
version "1.5.0"
8511+
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.5.0.tgz#e35db3f3ba3d41013feb65be02bdaa727ec7b8ec"
8512+
dependencies:
8513+
debug "^3.1.0"
8514+
extract-zip "^1.6.6"
8515+
https-proxy-agent "^2.2.1"
8516+
mime "^2.0.3"
8517+
progress "^2.0.0"
8518+
proxy-from-env "^1.0.0"
8519+
rimraf "^2.6.1"
8520+
ws "^5.1.1"
8521+
85288522
q@^1.0.1, q@^1.1.2, q@~1.5.0:
85298523
version "1.5.1"
85308524
resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
@@ -9199,12 +9193,6 @@ repeating@^2.0.0:
91999193
dependencies:
92009194
is-finite "^1.0.0"
92019195

9202-
request-progress@^2.0.1:
9203-
version "2.0.1"
9204-
resolved "https://registry.yarnpkg.com/request-progress/-/request-progress-2.0.1.tgz#5d36bb57961c673aa5b788dbc8141fdf23b44e08"
9205-
dependencies:
9206-
throttleit "^1.0.0"
9207-
92089196
92099197
version "1.1.1"
92109198
resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6"
@@ -9245,7 +9233,7 @@ [email protected]:
92459233
tough-cookie "~2.3.0"
92469234
tunnel-agent "~0.4.1"
92479235

9248-
request@^2.0.0, request@^2.74.0, request@^2.81.0, request@^2.83.0:
9236+
request@^2.0.0, request@^2.74.0, request@^2.83.0:
92499237
version "2.87.0"
92509238
resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e"
92519239
dependencies:
@@ -9657,9 +9645,9 @@ signal-exit@^3.0.0, signal-exit@^3.0.1, signal-exit@^3.0.2:
96579645
version "3.0.2"
96589646
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
96599647

9660-
sinon@^5.0.0:
9661-
version "5.1.1"
9662-
resolved "https://registry.yarnpkg.com/sinon/-/sinon-5.1.1.tgz#19c59810ffb733ea6e76a28b94a71fc4c2f523b8"
9648+
sinon@^6.0.0:
9649+
version "6.0.0"
9650+
resolved "https://registry.yarnpkg.com/sinon/-/sinon-6.0.0.tgz#f26627e4830dc34279661474da2c9e784f166215"
96639651
dependencies:
96649652
"@sinonjs/formatio" "^2.0.0"
96659653
diff "^3.5.0"
@@ -10260,10 +10248,6 @@ thenify-all@^1.0.0, thenify-all@^1.6.0:
1026010248
dependencies:
1026110249
any-promise "^1.0.0"
1026210250

10263-
throttleit@^1.0.0:
10264-
version "1.0.0"
10265-
resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c"
10266-
1026710251
through2@^2.0.0:
1026810252
version "2.0.3"
1026910253
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be"
@@ -11027,7 +11011,7 @@ which-module@^2.0.0:
1102711011
version "2.0.0"
1102811012
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
1102911013

11030-
which@^1.1.1, which@^1.2.10, which@^1.2.9, which@^1.3.0:
11014+
which@^1.1.1, which@^1.2.1, which@^1.2.9, which@^1.3.0:
1103111015
version "1.3.1"
1103211016
resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
1103311017
dependencies:
@@ -11221,6 +11205,12 @@ ws@^4.0.0:
1122111205
async-limiter "~1.0.0"
1122211206
safe-buffer "~5.1.0"
1122311207

11208+
ws@^5.1.1:
11209+
version "5.2.1"
11210+
resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.1.tgz#37827a0ba772d072a843c3615b0ad38bcdb354eb"
11211+
dependencies:
11212+
async-limiter "~1.0.0"
11213+
1122411214
ws@~3.3.1:
1122511215
version "3.3.3"
1122611216
resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2"

0 commit comments

Comments
 (0)