Skip to content

Commit

Permalink
Merge pull request #411 from cheplv/karma-electron
Browse files Browse the repository at this point in the history
Karma electron
  • Loading branch information
maximegris authored Nov 19, 2019
2 parents c43bb6c + 0f09907 commit 868d184
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ dist: xenial
sudo: required
services:
- xvfb
addons:
chrome: stable
before_script:
- export DISPLAY=:99.0
install:
Expand Down
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
],
"customWebpackConfig": {
"path": "./angular.webpack.js",
"target": "web"
"target": "electron-renderer"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
"jasmine-core": "3.4.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "4.2.0",
"karma-chrome-launcher": "3.0.0",
"karma-coverage-istanbul-reporter": "2.1.0",
"karma-electron": "^6.3.0",
"karma-jasmine": "2.0.1",
"karma-jasmine-html-reporter": "1.4.2",
"mocha": "6.2.0",
Expand Down
20 changes: 17 additions & 3 deletions src/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = function (config) {
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-electron'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
Expand All @@ -25,7 +25,21 @@ module.exports = function (config) {
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: true
browsers: ['AngularElectron'],
singleRun: true,
customLaunchers: {
AngularElectron: {
base: 'Electron',
browserWindowOptions: {
webPreferences: {
nodeIntegration: true,
allowRunningInsecureContent: true
}
}
}
},
client: {
useIframe: false
}
});
};

0 comments on commit 868d184

Please sign in to comment.