Fix karma tests

* "Shim" StripeCheckout
* Fix loadDependenciesForSession test
* Update karma coverage for better perf
This commit is contained in:
David Liu 2015-08-16 17:00:46 -07:00
parent 25c693eed4
commit 3266bd4621
3 changed files with 4 additions and 1 deletions

View file

@ -3,6 +3,7 @@
window.userObject = {_id:'1'}
window.StripeCheckout = {configure: function (){}}
initialize = require('core/initialize');
initialize.init();
console.debug = function() {}; // Karma conf doesn't seem to work? Debug messages are still emitted when they shouldn't be.

View file

@ -92,7 +92,7 @@
"karma": "~0.12",
"karma-chrome-launcher": "~0.1.2",
"karma-coffee-preprocessor": "~0.1.2",
"karma-coverage": "~0.1.4",
"karma-coverage": "~0.5.1",
"karma-firefox-launcher": "~0.1.3",
"karma-html2js-preprocessor": "~0.1.0",
"karma-jasmine": "~0.2.0",

View file

@ -94,6 +94,7 @@ describe 'LevelLoader', ->
describe 'loadDependenciesForSession', ->
it 'loads hero and item thang types from heroConfig in the given session', ->
levelLoader = new LevelLoader({supermodel:new SuperModel(), sessionID: 'id', levelID: 'id'})
levelLoader.sessionDependenciesRegistered = {}
session = new LevelSession(sessionWithAnyaWithGloves)
levelLoader.loadDependenciesForSession(session)
requests = jasmine.Ajax.requests.all()
@ -103,6 +104,7 @@ describe 'LevelLoader', ->
it 'loads components for the hero in the heroConfig in the given session', ->
levelLoader = new LevelLoader({supermodel:new SuperModel(), sessionID: 'id', levelID: 'id'})
levelLoader.sessionDependenciesRegistered = {}
session = new LevelSession(sessionWithAnyaWithGloves)
levelLoader.loadDependenciesForSession(session)
responses = {