Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.
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
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ jobs:
run: npm run lint
- name: Test
run: |
export DISPLAY=:99.0
xvfb-run --auto-servernum npm test -- --configuration=ci
npm run test:ci
23 changes: 20 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const webpackConfig = require('./webpack.config.js');
module.exports = function(config) {
config.set({
const configuration = {
basePath: '',
frameworks: ['jasmine'],
files: [
Expand All @@ -20,14 +20,31 @@ module.exports = function(config) {
resolve: webpackConfig().resolve,
mode: "development"
},
webpackMiddleware: {
stats: 'errors-only'
},
reporters: ['spec'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
captureTimeout: 60000,
autoWatch: true,
browsers: [process.env.TRAVIS ? 'Firefox' : 'Chrome'],
browsers: [process.env.TRAVIS ? 'Firefox' : 'ChromeHeadless'],
customLaunchers: {
FirefoxHeadless: {
base: 'Firefox',
flags: ['-headless'],
}
},
singleRun: false,
concurrency: Infinity,
});
};

// Detect CI environment using process.env.CI
if (process.env.CI) {
configuration.browsers = ['FirefoxHeadless'];
configuration.singleRun = true;
}

config.set(configuration);
};
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"url": "git+ssh://git@github.com/phrase/angular-phrase.git"
},
"scripts": {
"test": "npm lint | karma start --single-run",
"test": "npm run lint && karma start",
"test:ci": "npm run lint && karma start --configuration=ci --single-run",
"start": "webpack --mode development --w",
"build": "webpack --mode development | webpack --mode production",
"lint": "eslint src/**",
Expand All @@ -20,14 +21,15 @@
"@types/angular-mocks": "^1.7.0",
"@types/angular-translate": "^2.16.2",
"@types/jasmine": "^3.5.11",
"@types/node": "^14.14.10",
"@typescript-eslint/eslint-plugin": "^3.6.1",
"@typescript-eslint/parser": "^3.6.1",
"angular": "^1.7.8",
"angular-mocks": "^1.8.0",
"angular-translate": "^2.18.3",
"eslint": "^7.5.0",
"eslint-config-phrase": "git+https://github.com/phrase/eslint-config-phrase.git#v2",
"karma": "^5.1.0",
"karma": "^6.4.4",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^1.2.0",
"karma-jasmine": "^3.3.1",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"moduleResolution": "node",
"sourceMap": true,
"target": "es5",
"esModuleInterop": true
"esModuleInterop": true,
"skipLibCheck": true
},
"exclude": [
"node_modules"
Expand Down
Loading