Skip to content

Commit

Permalink
ci: add full support for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
EdricChan03 committed Dec 29, 2019
1 parent 3d79cf9 commit 294adcb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
run: npm ci
- name: Lint application
run: npm run lint
# - name: Test application
# run: npm test
- name: Test application
run: npm run action:test
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
- name: Lint application
run: npm run lint
- name: Test application
run: npm test
run: npm run action:test
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"build-prod-local": "ng build -c=httpserver --prod && cd dist && http-server",
"deploy": "ng deploy",
"action:deploy": "ng deploy --repo https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git --name $GITHUB_ACTOR --email [email protected] --no-silent",
"action:deployDryRun": "ng deploy --repo=https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git --name=$GITHUB_ACTOR [email protected] --no-silent --no-build"
"action:deployDryRun": "ng deploy --repo=https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git --name=$GITHUB_ACTOR [email protected] --no-silent --no-build",
"action:e2e": "ng e2e --protractor-config=projects/rss-reader/e2e/protractor-ci.conf.js",
"action:test": "ng test --no-watch --no-progress --code-coverage --browsers=ChromeHeadlessCI"
},
"private": true,
"dependencies": {
Expand Down
10 changes: 10 additions & 0 deletions projects/rss-reader/e2e/protractor-ci.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const config = require('./protractor.conf').config;

config.capabilities = {
browserName: 'chrome',
chromeOptions: {
args: ['--headless', '--no-sandbox']
}
};

exports.config = config;
15 changes: 10 additions & 5 deletions projects/rss-reader/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,27 @@ module.exports = function (config) {
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client:{
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
dir: require('path').join(__dirname, '../../coverage/rss-reader'),
// See https://istanbul.js.org/docs/advanced/alternative-reporters/ for more info.
reports: ['html', 'json-summary', 'text-summary'],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
},
singleRun: false
});
};

0 comments on commit 294adcb

Please sign in to comment.