Closed shaikhspear16 closed 7 years ago
Sorry I'm not quite sure I understand your question, are you asking why this window opens when your tests run?
The "Hello Angular" on the page is actually in my code's app.html file (page that loads with npm start). Ideally when you run karma tests this window comes up as a blank white page. I am afraid as my application matures, the application home page will be shown when test cases run with karma.
That's how karma works - it will compile and test your components in the browser so you'll see the output of the compiled component in the browser window. If you call fixture.destroy()
after the test is run it should remove it from the DOM. Alternatively just use a headless browser instead which won't have a browser window.
I have taken the latest Angular 2 Quickstart clone. I have updated the karma.config.js file according to the steps mentioned. My test cases run and the coverage report is generated in Typescript which is great!
The Chrome browser shows the default page of the application when test cases are run as follows:
karma.config.js file:
Why does the application output show?