Description
Bug Report
- [x] bug report -> please search issues before submitting
Area
- [x] `npm run test` or `ng test`
Versions
Angular CLI: 6.0.8
Node: 10.6.0
OS: linux x64 (Linux Mint)
Angular: 6.0.9
Npm: 6.1.0 and 6.2.0
Reproduction steps
ng new appWithJsdom
cd appWithJsdom
npm install
npm install karma-jsdom-launcher jsdom --save-dev
- modify src/karma.conf.js
diff --git a/src/karma.conf.js b/src/karma.conf.js
index b6e0042..c9f81b7 100644
--- a/src/karma.conf.js
+++ b/src/karma.conf.js
@@ -8,6 +8,7 @@ module.exports = function (config) {
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
+ require('karma-jsdom-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
@@ -24,8 +25,8 @@ module.exports = function (config) {
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
- autoWatch: true,
- browsers: ['Chrome'],
- singleRun: false
+ autoWatch: false,
+ browsers: ['jsdom'],
+ singleRun: true
});
};
The log given by the failure
Then ng test
displays build statements in CLI:
16 07 2018 13:06:35.821:WARN [karma]: Port 9876 in use
16 07 2018 13:06:35.823:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9878/
16 07 2018 13:06:35.823:INFO [launcher]: Launching browsers jsdom with unlimited concurrency
16 07 2018 13:06:35.842:INFO [launcher]: Starting browser jsdom
16 07 2018 13:06:40.252:INFO [Mozilla/5.0 (linux) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/11.11.0]: Connected on socket p6lvGGcG6uRr_zm5AAAB with id 26520884
The the console is cleared, nothings happens.
Ctrl-c eventually leads me back to the console.
This is repeatable.
No other user is connected to the desktop, no other node
instances are running concurrently.
Can't really run too many processes on it anyway.
When I use 'Chrome' or 'ChromeHeadless', the browser pops up etc, runs the tests all green.
Eveidently, I have the Chrome browser installed locally.
Desired functionality
I need a way to run the UI tests in a build process.
Tried PhantomJS - no luck.
Would like to use jsdom
as test browser for builds - as it does headless mode with minimal effort.
Can't install a browser on the build server.
Though puppeteer
and ChromeHeadless, the karma launcher fails with not finding libX11.so ...