Warn Launcher Can Not Load Phantomjs It Is Not Registered
Test Coverage with Karma
☰ Table of Contents
I got tired of flailing around in the dark, so after turning on the lights, I started looking into test coverage tools.
A few sources recommended Karma, so I went for it. It's good (sorry).
- Code Coverage of Jasmine Tests using Istanbul and Karma
- Capturing browser with Karma
| |
My config:
| |
But when I run it, I get provider errors.
| |
SO says I'm missing a dependency.
You have not yet installed
karma-jasmine node
module and its not listed indevDependencies
section in yourpackage.json
Okay.
| |
-.-
Dependencies all the way down.
I set up package.json
with an empty dependencies array, so the npm install -D
commands will add the appropriate packages:
| |
Then after running npm install karma karma-coverage karma-jasmine jasmine-core
, we end up with
| |
Progress!
| |
Changing browsers: ['PhantomJs']
to browsers: ['Chrome']
results in the same error message complaining about Chrome instead.
According to this issue, I apparently need to add karma plugins manually:
| |
Config is now:
| |
New error, more missing libs
| |
Adding the plugin:
| |
This appeared in the package.json
:
| |
Once more unto:
| |
Found this:
I forgot to add
karma-coverage
to the list of plugins. This should be added to the sample config in the readme.
Another issue saying I'm missing a plugin. Added it.
| |
Twice more unto:
| |
I guessed that I needed to change karma-phantomjs-launcher
to karma-chrome-launcher
in the plugins list.
| |
(╯°□°)╯︵ ┻━┻
ヘ(´° □°)ヘ┳━┳
| |
And now in devDependencies
, a wild "karma-chrome-launcher": "^2.2.0"
appears!
Then things started to happen! A browser window opened and closed right away, but I still can't see coverage because the tests are not behaving the same as they were with Jasmine through the browser. This is probably because of how they're being loaded.
Looks like I have some test errors to resolve!
<< Canvas Tech Debt Stabilizing Tests for Karma Coverage >>
See Also
- Canvas Tech Debt
- Gamepad Controls Library Updates
- Nerding Out on Robotron
- Fly Droppings and Pausing
- HTML5 Canvas Gamepad Movement
Warn Launcher Can Not Load Phantomjs It Is Not Registered
Source: https://blog.matthewodle.com/game-dev-session-test-coverage-with-karma/