Skip to content

Commit

Permalink
ci: adding configuration to run test in circle ci
Browse files Browse the repository at this point in the history
  • Loading branch information
edoparearyee committed Apr 11, 2018
1 parent ee6d080 commit 782dd56
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 5 deletions.
23 changes: 23 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,23 @@
#
# CircleCI configuration for angular-starter
#

version: 2
jobs:
build:
working_directory: ~/angular-starter
docker:
- image: circleci/node:8-browsers
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run: npm i --no-progress
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- node_modules
- run: npm run lint
- run: npm run test -- --single-run --code-coverage --no-progress
- run: npm run e2e -- --no-progress
- run: npm run coverage
13 changes: 11 additions & 2 deletions karma.conf.js
Expand Up @@ -6,6 +6,7 @@ module.exports = function (config) {
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-spec-reporter'),
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
Expand All @@ -16,18 +17,26 @@ module.exports = function (config) {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
reports: [ 'html', 'lcovonly', 'text-summary' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: ['progress', 'kjhtml'],
reporters: config.angularCli && config.angularCli.codeCoverage ?
['spec', 'kjhtml', 'coverage-istanbul'] :
['spec', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
customLaunchers: {
ChromeNoSandbox: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
singleRun: false
});
};
42 changes: 42 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "angular-starter",
"version": "1.0.0",
"description": "An example SOON_ Angular project by SOON_",
"description": "An example Angular project by SOON_",
"private": false,
"license": "MIT",
"repository": {
Expand All @@ -20,6 +20,7 @@
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"coverage": "coveralls < coverage/lcov.info",
"release": "standard-version"
},
"dependencies": {
Expand All @@ -44,6 +45,7 @@
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"coveralls": "^3.0.0",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
Expand All @@ -56,7 +58,8 @@
"tslint": "~5.9.1",
"typescript": "~2.5.3",
"cz-conventional-changelog": "^2.1.0",
"standard-version": "^4.3.0"
"standard-version": "^4.3.0",
"karma-spec-reporter": "0.0.32"
},
"engines": {
"node": ">= 8.9.0",
Expand Down
5 changes: 4 additions & 1 deletion protractor.conf.js
Expand Up @@ -9,7 +9,10 @@ exports.config = {
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
browserName: 'chrome',
chromeOptions: {
args: ['--no-sandbox']
}
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
Expand Down

0 comments on commit 782dd56

Please sign in to comment.