Running karma tests using the dependency of the Google Maps module

So, I have included this module in my Angular app https://github.com/nlaplante/angular-google-maps

Now the question arises: how to run Karma tests that integrate it?

Running "karma:unit" (karma) task
INFO [karma]: Karma v0.10.6 server started at http://localhost:8080/
INFO [launcher]: Starting browser Chrome
WARN [watcher]: Pattern "/Users/Work/status/test/mock/**/*.js" does not match any file.
INFO [Chrome 31.0.1650 (Mac OS X 10.8.4)]: Connected on socket iLYLgPcHaw8HVJjNNafq
Chrome 31.0.1650 (Mac OS X 10.8.4) ERROR
    Uncaught ReferenceError: google is not defined
    at /Users/Work/status/app/scripts/angular-google-maps.min.js:6
Chrome 31.0.1650 (Mac OS X 10.8.4): Executed 0 of 0 ERROR (0.509 secs / 0 secs)
Warning: Task "karma:unit" failed. Used --force, continuing.

Done, but with warnings.

So this is a global google object that is missing

I see a couple of solutions, but I don’t know how to implement them:

-Include google script every time we run tests (albeit ineffective). The question is, how and where do I insert it?

<script src="http://maps.googleapis.com/maps/api/js?sensor=false&language=en"></script>

-i read a sentence somewhere that we could mock Google APIs

+4
source share

All Articles