How to run jasmine tests without browser ?
See original GitHub issueOS: Ubuntu 14.04.3 in a docker environment, without web browser (it’s actually running in Cloud9)
Version: angular-cli: 1.0.0-beta.11-webpack.8 node: 6.5.0 os: linux x64
Without any browser installed in the os, I cannot find a way to execute jasmine unit tests in spec files.
running ng test :
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
WARNING in ./src/app/app.component.ts
[208, 7]: comment must start with a space
[20, 3]: Declaration of public instance member variable not allowed to appear after declaration of public instance member function
...
07 09 2016 20:57:41.939:WARN [karma]: No captured browser, open http://0.0.0.0:9876/
07 09 2016 20:57:41.947:INFO [karma]: Karma v0.13.22 server started at http://0.0.0.0:9876/
07 09 2016 20:57:41.955:INFO [launcher]: Starting browser Chrome
07 09 2016 20:57:41.958:ERROR [launcher]: No binary for Chrome browser on your platform.
Please, set "CHROME_BIN" env variable.
No error shown even if some tests have
expect(true).toEqual(false);
Is there a way to execute these tests in a console-only environment ?
Thanks !
Issue Analytics
- State:
- Created 7 years ago
- Reactions:20
- Comments:29 (1 by maintainers)
Top Results From Across the Web
How can I run tests with a headless browser? - Stack Overflow
Angular provides all what we need to run tests without a browser. Open the karma.conf.js file and add the ChromeHeadless to the browsers...
Read more >Run Angular Unit Test Cases Without Browser Karma Jasmine
There are two way to configure the Angular unit test cases to run without the browser. From command line. While running the unit...
Read more >jasmine-headless-webkit - johnbintz.com
jasmine -headless-webkit uses the QtWebKit widget to run your specs without needing to render a pixel. It's nearly as fast as running in...
Read more >Jasmine & Karma • Angular - codecraft.tv
Karma. Manually running Jasmine tests by refreshing a browser tab repeatedly in different browsers every time we edit some code can become tiresome....
Read more >Jasmine JS: Start Testing From-Scratch - Testim.io
How do I Run a Unit Test On Jasmine? · Setting up Jasmine · Download and Set Up Jasmine · Executing a Jasmine...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Hashnode Post
No results found
Here is how I did it.
Then I modified the
pluginsproperty of thekarma.conf.jsfile, adding the PhantomJS plugin to the list. Also add PhantomJS to thebrowsersproperty.Since you want a completely headless experience, you can remove Chrome from the
browsersproperty, and remove thekarma-chrome-launcherfrom thepluginsarray as well.Hi all,
For me it’s still not working. I’ve followed all these steps as well.
1. Install
phantomjs:2. Add import to
karma.conf.js:3. Install intl
npm install --save-dev intl4. Uncomment polyfills’ imports:
5. Target for
es5instead ofes6intsconfig.spec.json:"target": "es5",But still doesn’t work. I receive this from running:
ng test --browsers PhantomJS --watch=falseAlready tried to increase the timeout value but there is no difference.
Does anybody know if I’m skipping some steps here?
Thanks so much in advance.