Last active
August 29, 2015 13:56
-
-
Save ninjapanzer/9117204 to your computer and use it in GitHub Desktop.
Impact Testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('Plugins/SkinManager', function() { | |
| it('init', function() { | |
| var global={}; | |
| global.sm; | |
| runs(function(){ | |
| testModule({ for:"skin-manager", requires:["plugins.skin-manager"] }).defines(function() { | |
| console.log('Executing module'); | |
| global.sm = ig.skinManager; | |
| expect(true).toBe(true); | |
| }); | |
| }); | |
| waitsFor(function(){ | |
| console.log("waiting: current val " + global.sm); | |
| if(global.sm != undefined) | |
| return true; | |
| }, "waiting for module", 500); | |
| runs(function() { | |
| console.log("executing tests"); | |
| console.log('global.sm = ' + global.sm) | |
| expect(global.sm.skin).toBe(2); | |
| }); | |
| }); | |
| /* it('getRootPath', function() { | |
| waitsFor( | |
| function(){ testModuleFor('skin-manager', ['plugins.skin-manager']).defines(function() { | |
| gameData.skin = 15; | |
| var sm = new SkinManager(); | |
| expect(sm.getRootPath()).toEqual('media/skins/15/'); | |
| ig.prefix = 'prefix'; | |
| expect(sm.getRootPath()).toEqual('media/skins/15/'); | |
| }); | |
| }); | |
| }); | |
| it('getImage', function() { | |
| waitsFor(function(){ | |
| testModuleFor('skin-manager', ['plugins.skin-manager']).defines(function() { | |
| var sm = new SkinManager(); | |
| var image = sm.getImage('logo.png'); | |
| console.log(image); | |
| image = sm.getImage('logo23232.png'); | |
| console.log(image); | |
| expect().toEqual(true); | |
| }); | |
| }); | |
| }); | |
| it('getTextureAtlas', function() { | |
| waitsFor(function(){ | |
| testModuleFor('skin-manager', ['plugins.skin-manager']).defines(function() { | |
| var sm = new SkinManager(); | |
| var image = sm.getTextureAtlas('sprites.png'); | |
| console.log(image); | |
| image = sm.getTextureAtlas('logo23232.png'); | |
| console.log(image); | |
| expect(sm.getRootPath()).toEqual('media/skins/15/'); | |
| }); | |
| }); | |
| }); | |
| it('processSoundManifest', function() { | |
| waitsFor(function(){ | |
| testModuleFor('skin-manager', ['plugins.skin-manager']).defines(function() { | |
| var sm = new SkinManager(); | |
| var manifest = sm.getSoundManifest([{ id: "music", src: "background-music.ogg" }]); | |
| console.log(manifest); | |
| expect().toEqual('media/skins/15/'); | |
| }); | |
| }); | |
| }); | |
| */ | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment