Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit 1474bed

Browse files
wip
1 parent b9f6ef3 commit 1474bed

3 files changed

Lines changed: 23 additions & 5 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
- name: Test
1717
run: |
1818
export DISPLAY=:99.0
19-
xvfb-run --auto-servernum npm test -- --configuration=ci
19+
xvfb-run --auto-servernum npm run test:ci

karma.conf.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const webpackConfig = require('./webpack.config.js');
22
module.exports = function(config) {
3-
config.set({
3+
const configuration = {
44
basePath: '',
55
frameworks: ['jasmine'],
66
files: [
@@ -20,14 +20,31 @@ module.exports = function(config) {
2020
resolve: webpackConfig().resolve,
2121
mode: "development"
2222
},
23+
webpackMiddleware: {
24+
stats: 'errors-only'
25+
},
2326
reporters: ['spec'],
2427
port: 9876,
2528
colors: true,
2629
logLevel: config.LOG_INFO,
2730
captureTimeout: 60000,
2831
autoWatch: true,
29-
browsers: [process.env.TRAVIS ? 'Firefox' : 'Chrome'],
32+
browsers: [process.env.TRAVIS ? 'Firefox' : 'ChromeHeadless'],
33+
customLaunchers: {
34+
FirefoxHeadless: {
35+
base: 'Firefox',
36+
flags: ['-headless'],
37+
}
38+
},
3039
singleRun: false,
3140
concurrency: Infinity,
32-
});
41+
};
42+
43+
// Handle --configuration=ci parameter
44+
if (process.argv.includes('--configuration=ci')) {
45+
configuration.browsers = ['FirefoxHeadless'];
46+
configuration.singleRun = true;
47+
}
48+
49+
config.set(configuration);
3350
};

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"url": "git+ssh://git@github.com/phrase/angular-phrase.git"
88
},
99
"scripts": {
10-
"test": "npm lint | karma start --single-run",
10+
"test": "npm run lint && karma start",
11+
"test:ci": "npm run lint && karma start --configuration=ci --single-run",
1112
"start": "webpack --mode development --w",
1213
"build": "webpack --mode development | webpack --mode production",
1314
"lint": "eslint src/**",

0 commit comments

Comments
 (0)