Skip to content

Commit 1f095b6

Browse files
Add tests to pipeline
1 parent 44b6657 commit 1f095b6

File tree

4 files changed

+165
-5
lines changed

4 files changed

+165
-5
lines changed

azure-pipelines.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,20 @@ steps:
1616
displayName: 'Install Node.js'
1717

1818
- script: npm install
19-
displayName: 'npm install'
19+
displayName: 'Install Packages'
2020

2121
- script: npm run build:lib
22-
displayName: 'build library'
22+
displayName: 'Build Library'
2323

2424
- script: npm run build:app
25-
displayName: 'build app'
25+
displayName: 'Build App'
26+
27+
- script: npx ng test --watch=false
28+
displayName: 'Execute Tests'
29+
30+
- task: PublishTestResults@2
31+
condition: succeededOrFailed()
32+
inputs:
33+
testResultsFormat: 'JUnit'
34+
testResultsFiles: '**/TEST-*.xml'
35+
displayName: 'Publish Test Results'

karma.conf.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Karma configuration file, see link for more information
22
// https://karma-runner.github.io/1.0/config/configuration-file.html
33

4+
const process = require('process');
5+
process.env.CHROME_BIN = require('puppeteer').executablePath();
6+
47
module.exports = function (config) {
58
config.set({
69
basePath: '',
@@ -10,6 +13,7 @@ module.exports = function (config) {
1013
require('karma-chrome-launcher'),
1114
require('karma-jasmine-html-reporter'),
1215
require('karma-coverage-istanbul-reporter'),
16+
require('karma-junit-reporter'),
1317
require('@angular-devkit/build-angular/plugins/karma')
1418
],
1519
client:{
@@ -22,12 +26,12 @@ module.exports = function (config) {
2226
angularCli: {
2327
environment: 'dev'
2428
},
25-
reporters: ['progress', 'kjhtml'],
29+
reporters: ['progress', 'kjhtml', 'junit'],
2630
port: 9876,
2731
colors: true,
2832
logLevel: config.LOG_INFO,
2933
autoWatch: true,
30-
browsers: ['Chrome'],
34+
browsers: ['ChromeHeadless'],
3135
singleRun: false
3236
});
3337
};

package-lock.json

Lines changed: 144 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@
4545
"karma-coverage-istanbul-reporter": "2.0.5",
4646
"karma-jasmine": "2.0.1",
4747
"karma-jasmine-html-reporter": "1.4.2",
48+
"karma-junit-reporter": "^2.0.1",
4849
"ng-packagr": "^5.2.0",
4950
"protractor": "5.4.2",
51+
"puppeteer": "^2.0.0",
5052
"ts-node": "8.2.0",
5153
"tsickle": "^0.35.0",
5254
"tslint": "5.17.0",

0 commit comments

Comments
 (0)