Skip to content

Chrome headless & yarn for testing #1437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 6 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,18 @@ node_js:

addons:
chrome: stable
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8

cache: npm

env:
- CXX=g++-4.8
branches:
only:
- master # otherwise pull requests get built twice

install:
# ditched yarn, since it was acting up and giving old versions of tsc
- npm install

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- yarn install

script:
- npm run build
- ./node_modules/.bin/karma start --single-run --browsers Firefox --reporters mocha
- yarn run build
- ./node_modules/.bin/karma start --single-run --browsers ChromeHeadlessTravis --reporters mocha
# Run integration test to make sure our typings are correct for user-land.
- node tools/run-typings-test.js

notifications:
webhooks:
on_success: always # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false
10 changes: 8 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ module.exports = function(config) {
logLevel: config.LOG_INFO,
autoWatch: true,
reporters: ['mocha'],
browsers: ['Firefox'],
singleRun: false
browsers: ['Chrome', 'ChromeHeadless', 'Firefox', 'ChromeHeadlessTravis'],
singleRun: false,
customLaunchers: {
ChromeHeadlessTravis: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
},
})
};

Expand Down
2 changes: 1 addition & 1 deletion tools/run-typings-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ncp(pathToTestSrcFolder, pathToTestFolder, () => {
.replace('{{TYPESCRIPT_VERSION}}', rootPackage.devDependencies.typescript)
.replace(/\{\{ANGULAR_VERSION\}\}/g, rootPackage.dependencies['@angular/core']));

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