Skip to content

Commit 9d2cd2e

Browse files
authored
chore(): Headless Chrome & yarn on Travis (#1437)
* Using headless Chrome for karma tests, `--no-sandbox` needed on Travis * Going back to using `yarn` * Only build PRs once * Pruning the `.travis.yml`
1 parent aadc71a commit 9d2cd2e

File tree

3 files changed

+15
-24
lines changed

3 files changed

+15
-24
lines changed

.travis.yml

+6-21
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,18 @@ node_js:
55

66
addons:
77
chrome: stable
8-
apt:
9-
sources:
10-
- ubuntu-toolchain-r-test
11-
packages:
12-
- g++-4.8
138

149
cache: npm
1510

16-
env:
17-
- CXX=g++-4.8
11+
branches:
12+
only:
13+
- master # otherwise pull requests get built twice
1814

1915
install:
20-
# ditched yarn, since it was acting up and giving old versions of tsc
21-
- npm install
22-
23-
before_script:
24-
- export DISPLAY=:99.0
25-
- sh -e /etc/init.d/xvfb start
16+
- yarn install
2617

2718
script:
28-
- npm run build
29-
- ./node_modules/.bin/karma start --single-run --browsers Firefox --reporters mocha
19+
- yarn run build
20+
- ./node_modules/.bin/karma start --single-run --browsers ChromeHeadlessTravis --reporters mocha
3021
# Run integration test to make sure our typings are correct for user-land.
3122
- node tools/run-typings-test.js
32-
33-
notifications:
34-
webhooks:
35-
on_success: always # options: [always|never|change] default: always
36-
on_failure: always # options: [always|never|change] default: always
37-
on_start: false # default: false

karma.conf.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,14 @@ module.exports = function(config) {
4141
logLevel: config.LOG_INFO,
4242
autoWatch: true,
4343
reporters: ['mocha'],
44-
browsers: ['Firefox'],
45-
singleRun: false
44+
browsers: ['Chrome', 'ChromeHeadless', 'Firefox', 'ChromeHeadlessTravis'],
45+
singleRun: false,
46+
customLaunchers: {
47+
ChromeHeadlessTravis: {
48+
base: 'ChromeHeadless',
49+
flags: ['--no-sandbox']
50+
}
51+
},
4652
})
4753
};
4854

tools/run-typings-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ncp(pathToTestSrcFolder, pathToTestFolder, () => {
3535
.replace('{{TYPESCRIPT_VERSION}}', rootPackage.devDependencies.typescript)
3636
.replace(/\{\{ANGULAR_VERSION\}\}/g, rootPackage.dependencies['@angular/core']));
3737

38-
spawnIt('npm', ['install'])
38+
spawnIt('yarn', ['install'])
3939
.then(_ => spawnIt(`${pathToTestFolder}/node_modules/.bin/tsc`, ['--version']))
4040
.then(_ => new Promise((res, rej) => {
4141
child_process.exec(`${pathToTestFolder}/node_modules/.bin/tsc --diagnostics -p ${pathToTestFolder}/tsconfig-test.json`, (err, stdout, stderr) => {

0 commit comments

Comments
 (0)