diff --git a/.jshintrc b/.jshintrc index b913f2b..08babe8 100644 --- a/.jshintrc +++ b/.jshintrc @@ -37,11 +37,23 @@ "maxcomplexity" : false, // Restrict the cyclomatic complexity of the code. "maxlen" : 220, // Require that all lines are 100 characters or less. "globals" : { // Register globals that are used in the code. + //commonjs globals "module": false, "require": false, + // PIXI globals "PIXI": false, - "spine": false + "spine": false, + + //chai globals + "chai": false, + + //mocha globals + "describe": false, + "it": false, + + //resemble globals + "resemble": false }, // == Relaxing Options ================================================ diff --git a/.jshintrc b/.jshintrc index b913f2b..08babe8 100644 --- a/.jshintrc +++ b/.jshintrc @@ -37,11 +37,23 @@ "maxcomplexity" : false, // Restrict the cyclomatic complexity of the code. "maxlen" : 220, // Require that all lines are 100 characters or less. "globals" : { // Register globals that are used in the code. + //commonjs globals "module": false, "require": false, + // PIXI globals "PIXI": false, - "spine": false + "spine": false, + + //chai globals + "chai": false, + + //mocha globals + "describe": false, + "it": false, + + //resemble globals + "resemble": false }, // == Relaxing Options ================================================ diff --git a/Gruntfile.js b/Gruntfile.js index 1952af7..ed72644 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -97,7 +97,7 @@ }, files: { srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit}/**/*.js', + testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js', build: '<%= dirs.build %>/pixi.dev.js', buildMin: '<%= dirs.build %>/pixi.js' }, @@ -122,10 +122,18 @@ } }, jshint: { - src: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), - test: ['<%= files.testBlob %>'], options: { jshintrc: '.jshintrc' + }, + source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), + test: { + src: ['<%= files.testBlob %>'], + options: { + jshintrc: undefined, //don't use jshintrc for tests + expr: true, + undef: false, + camelcase: false + } } }, uglify: { @@ -170,7 +178,7 @@ grunt.registerTask('default', ['build', 'test']); - grunt.registerTask('build', ['jshint:src', 'concat', 'uglify']); + grunt.registerTask('build', ['jshint:source', 'concat', 'uglify']); grunt.registerTask('build-debug', ['concat_sourcemap', 'uglify']); grunt.registerTask('test', ['concat', 'jshint:test', 'karma']); diff --git a/.jshintrc b/.jshintrc index b913f2b..08babe8 100644 --- a/.jshintrc +++ b/.jshintrc @@ -37,11 +37,23 @@ "maxcomplexity" : false, // Restrict the cyclomatic complexity of the code. "maxlen" : 220, // Require that all lines are 100 characters or less. "globals" : { // Register globals that are used in the code. + //commonjs globals "module": false, "require": false, + // PIXI globals "PIXI": false, - "spine": false + "spine": false, + + //chai globals + "chai": false, + + //mocha globals + "describe": false, + "it": false, + + //resemble globals + "resemble": false }, // == Relaxing Options ================================================ diff --git a/Gruntfile.js b/Gruntfile.js index 1952af7..ed72644 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -97,7 +97,7 @@ }, files: { srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit}/**/*.js', + testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js', build: '<%= dirs.build %>/pixi.dev.js', buildMin: '<%= dirs.build %>/pixi.js' }, @@ -122,10 +122,18 @@ } }, jshint: { - src: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), - test: ['<%= files.testBlob %>'], options: { jshintrc: '.jshintrc' + }, + source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), + test: { + src: ['<%= files.testBlob %>'], + options: { + jshintrc: undefined, //don't use jshintrc for tests + expr: true, + undef: false, + camelcase: false + } } }, uglify: { @@ -170,7 +178,7 @@ grunt.registerTask('default', ['build', 'test']); - grunt.registerTask('build', ['jshint:src', 'concat', 'uglify']); + grunt.registerTask('build', ['jshint:source', 'concat', 'uglify']); grunt.registerTask('build-debug', ['concat_sourcemap', 'uglify']); grunt.registerTask('test', ['concat', 'jshint:test', 'karma']); diff --git a/test/functional/example-1-basics/index.js b/test/functional/example-1-basics/index.js index 7ae7a98..2ad32bd 100644 --- a/test/functional/example-1-basics/index.js +++ b/test/functional/example-1-basics/index.js @@ -16,7 +16,7 @@ function animate() { currentFrame += 1; - requestAnimFrame( animate ); + window.requestAnimFrame( animate ); // just for fun, lets rotate mr rabbit a little bunny.rotation += 0.1; @@ -39,10 +39,10 @@ // add the renderer view element to the DOM document.body.appendChild(renderer.view); - requestAnimFrame( animate ); + window.requestAnimFrame( animate ); // create a texture from an image path - var texture = PIXI.Texture.fromImage(baseUri + "/bunny.png"); + var texture = PIXI.Texture.fromImage(baseUri + '/bunny.png'); // create a new Sprite using the texture bunny = new PIXI.Sprite(texture); @@ -67,7 +67,7 @@ // loader.on('onProgress', function (event) { // console.log(event.content); // }); - loader.on('onComplete', function (event) { + loader.on('onComplete', function () { done(); initScene(); }); diff --git a/.jshintrc b/.jshintrc index b913f2b..08babe8 100644 --- a/.jshintrc +++ b/.jshintrc @@ -37,11 +37,23 @@ "maxcomplexity" : false, // Restrict the cyclomatic complexity of the code. "maxlen" : 220, // Require that all lines are 100 characters or less. "globals" : { // Register globals that are used in the code. + //commonjs globals "module": false, "require": false, + // PIXI globals "PIXI": false, - "spine": false + "spine": false, + + //chai globals + "chai": false, + + //mocha globals + "describe": false, + "it": false, + + //resemble globals + "resemble": false }, // == Relaxing Options ================================================ diff --git a/Gruntfile.js b/Gruntfile.js index 1952af7..ed72644 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -97,7 +97,7 @@ }, files: { srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit}/**/*.js', + testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js', build: '<%= dirs.build %>/pixi.dev.js', buildMin: '<%= dirs.build %>/pixi.js' }, @@ -122,10 +122,18 @@ } }, jshint: { - src: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), - test: ['<%= files.testBlob %>'], options: { jshintrc: '.jshintrc' + }, + source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), + test: { + src: ['<%= files.testBlob %>'], + options: { + jshintrc: undefined, //don't use jshintrc for tests + expr: true, + undef: false, + camelcase: false + } } }, uglify: { @@ -170,7 +178,7 @@ grunt.registerTask('default', ['build', 'test']); - grunt.registerTask('build', ['jshint:src', 'concat', 'uglify']); + grunt.registerTask('build', ['jshint:source', 'concat', 'uglify']); grunt.registerTask('build-debug', ['concat_sourcemap', 'uglify']); grunt.registerTask('test', ['concat', 'jshint:test', 'karma']); diff --git a/test/functional/example-1-basics/index.js b/test/functional/example-1-basics/index.js index 7ae7a98..2ad32bd 100644 --- a/test/functional/example-1-basics/index.js +++ b/test/functional/example-1-basics/index.js @@ -16,7 +16,7 @@ function animate() { currentFrame += 1; - requestAnimFrame( animate ); + window.requestAnimFrame( animate ); // just for fun, lets rotate mr rabbit a little bunny.rotation += 0.1; @@ -39,10 +39,10 @@ // add the renderer view element to the DOM document.body.appendChild(renderer.view); - requestAnimFrame( animate ); + window.requestAnimFrame( animate ); // create a texture from an image path - var texture = PIXI.Texture.fromImage(baseUri + "/bunny.png"); + var texture = PIXI.Texture.fromImage(baseUri + '/bunny.png'); // create a new Sprite using the texture bunny = new PIXI.Sprite(texture); @@ -67,7 +67,7 @@ // loader.on('onProgress', function (event) { // console.log(event.content); // }); - loader.on('onComplete', function (event) { + loader.on('onComplete', function () { done(); initScene(); }); diff --git a/test/unit/pixi/filters/MaskFilter.js b/test/unit/pixi/filters/MaskFilter.js index 32d6a45..695f078 100644 --- a/test/unit/pixi/filters/MaskFilter.js +++ b/test/unit/pixi/filters/MaskFilter.js @@ -2,9 +2,9 @@ 'use strict'; var expect = chai.expect; - // var MaskFilter = PIXI.MaskFilter; + var MaskFilter = PIXI.MaskFilter; - // it('Module exists', function () { - // expect(MaskFilter).to.be.a('function'); - // }); + it('Module exists', function () { + expect(MaskFilter).to.be.a('function'); + }); }); diff --git a/.jshintrc b/.jshintrc index b913f2b..08babe8 100644 --- a/.jshintrc +++ b/.jshintrc @@ -37,11 +37,23 @@ "maxcomplexity" : false, // Restrict the cyclomatic complexity of the code. "maxlen" : 220, // Require that all lines are 100 characters or less. "globals" : { // Register globals that are used in the code. + //commonjs globals "module": false, "require": false, + // PIXI globals "PIXI": false, - "spine": false + "spine": false, + + //chai globals + "chai": false, + + //mocha globals + "describe": false, + "it": false, + + //resemble globals + "resemble": false }, // == Relaxing Options ================================================ diff --git a/Gruntfile.js b/Gruntfile.js index 1952af7..ed72644 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -97,7 +97,7 @@ }, files: { srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit}/**/*.js', + testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js', build: '<%= dirs.build %>/pixi.dev.js', buildMin: '<%= dirs.build %>/pixi.js' }, @@ -122,10 +122,18 @@ } }, jshint: { - src: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), - test: ['<%= files.testBlob %>'], options: { jshintrc: '.jshintrc' + }, + source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), + test: { + src: ['<%= files.testBlob %>'], + options: { + jshintrc: undefined, //don't use jshintrc for tests + expr: true, + undef: false, + camelcase: false + } } }, uglify: { @@ -170,7 +178,7 @@ grunt.registerTask('default', ['build', 'test']); - grunt.registerTask('build', ['jshint:src', 'concat', 'uglify']); + grunt.registerTask('build', ['jshint:source', 'concat', 'uglify']); grunt.registerTask('build-debug', ['concat_sourcemap', 'uglify']); grunt.registerTask('test', ['concat', 'jshint:test', 'karma']); diff --git a/test/functional/example-1-basics/index.js b/test/functional/example-1-basics/index.js index 7ae7a98..2ad32bd 100644 --- a/test/functional/example-1-basics/index.js +++ b/test/functional/example-1-basics/index.js @@ -16,7 +16,7 @@ function animate() { currentFrame += 1; - requestAnimFrame( animate ); + window.requestAnimFrame( animate ); // just for fun, lets rotate mr rabbit a little bunny.rotation += 0.1; @@ -39,10 +39,10 @@ // add the renderer view element to the DOM document.body.appendChild(renderer.view); - requestAnimFrame( animate ); + window.requestAnimFrame( animate ); // create a texture from an image path - var texture = PIXI.Texture.fromImage(baseUri + "/bunny.png"); + var texture = PIXI.Texture.fromImage(baseUri + '/bunny.png'); // create a new Sprite using the texture bunny = new PIXI.Sprite(texture); @@ -67,7 +67,7 @@ // loader.on('onProgress', function (event) { // console.log(event.content); // }); - loader.on('onComplete', function (event) { + loader.on('onComplete', function () { done(); initScene(); }); diff --git a/test/unit/pixi/filters/MaskFilter.js b/test/unit/pixi/filters/MaskFilter.js index 32d6a45..695f078 100644 --- a/test/unit/pixi/filters/MaskFilter.js +++ b/test/unit/pixi/filters/MaskFilter.js @@ -2,9 +2,9 @@ 'use strict'; var expect = chai.expect; - // var MaskFilter = PIXI.MaskFilter; + var MaskFilter = PIXI.MaskFilter; - // it('Module exists', function () { - // expect(MaskFilter).to.be.a('function'); - // }); + it('Module exists', function () { + expect(MaskFilter).to.be.a('function'); + }); }); diff --git a/test/unit/pixi/loaders/BitmapFontLoader.js b/test/unit/pixi/loaders/BitmapFontLoader.js index 6253c42..046f018 100644 --- a/test/unit/pixi/loaders/BitmapFontLoader.js +++ b/test/unit/pixi/loaders/BitmapFontLoader.js @@ -2,7 +2,6 @@ 'use strict'; var expect = chai.expect; - var BitmapFontLoader = PIXI.BitmapFontLoader; it('Module exists', function () { expect(PIXI.BitmapFontLoader).to.be.a('function'); diff --git a/.jshintrc b/.jshintrc index b913f2b..08babe8 100644 --- a/.jshintrc +++ b/.jshintrc @@ -37,11 +37,23 @@ "maxcomplexity" : false, // Restrict the cyclomatic complexity of the code. "maxlen" : 220, // Require that all lines are 100 characters or less. "globals" : { // Register globals that are used in the code. + //commonjs globals "module": false, "require": false, + // PIXI globals "PIXI": false, - "spine": false + "spine": false, + + //chai globals + "chai": false, + + //mocha globals + "describe": false, + "it": false, + + //resemble globals + "resemble": false }, // == Relaxing Options ================================================ diff --git a/Gruntfile.js b/Gruntfile.js index 1952af7..ed72644 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -97,7 +97,7 @@ }, files: { srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit}/**/*.js', + testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js', build: '<%= dirs.build %>/pixi.dev.js', buildMin: '<%= dirs.build %>/pixi.js' }, @@ -122,10 +122,18 @@ } }, jshint: { - src: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), - test: ['<%= files.testBlob %>'], options: { jshintrc: '.jshintrc' + }, + source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'), + test: { + src: ['<%= files.testBlob %>'], + options: { + jshintrc: undefined, //don't use jshintrc for tests + expr: true, + undef: false, + camelcase: false + } } }, uglify: { @@ -170,7 +178,7 @@ grunt.registerTask('default', ['build', 'test']); - grunt.registerTask('build', ['jshint:src', 'concat', 'uglify']); + grunt.registerTask('build', ['jshint:source', 'concat', 'uglify']); grunt.registerTask('build-debug', ['concat_sourcemap', 'uglify']); grunt.registerTask('test', ['concat', 'jshint:test', 'karma']); diff --git a/test/functional/example-1-basics/index.js b/test/functional/example-1-basics/index.js index 7ae7a98..2ad32bd 100644 --- a/test/functional/example-1-basics/index.js +++ b/test/functional/example-1-basics/index.js @@ -16,7 +16,7 @@ function animate() { currentFrame += 1; - requestAnimFrame( animate ); + window.requestAnimFrame( animate ); // just for fun, lets rotate mr rabbit a little bunny.rotation += 0.1; @@ -39,10 +39,10 @@ // add the renderer view element to the DOM document.body.appendChild(renderer.view); - requestAnimFrame( animate ); + window.requestAnimFrame( animate ); // create a texture from an image path - var texture = PIXI.Texture.fromImage(baseUri + "/bunny.png"); + var texture = PIXI.Texture.fromImage(baseUri + '/bunny.png'); // create a new Sprite using the texture bunny = new PIXI.Sprite(texture); @@ -67,7 +67,7 @@ // loader.on('onProgress', function (event) { // console.log(event.content); // }); - loader.on('onComplete', function (event) { + loader.on('onComplete', function () { done(); initScene(); }); diff --git a/test/unit/pixi/filters/MaskFilter.js b/test/unit/pixi/filters/MaskFilter.js index 32d6a45..695f078 100644 --- a/test/unit/pixi/filters/MaskFilter.js +++ b/test/unit/pixi/filters/MaskFilter.js @@ -2,9 +2,9 @@ 'use strict'; var expect = chai.expect; - // var MaskFilter = PIXI.MaskFilter; + var MaskFilter = PIXI.MaskFilter; - // it('Module exists', function () { - // expect(MaskFilter).to.be.a('function'); - // }); + it('Module exists', function () { + expect(MaskFilter).to.be.a('function'); + }); }); diff --git a/test/unit/pixi/loaders/BitmapFontLoader.js b/test/unit/pixi/loaders/BitmapFontLoader.js index 6253c42..046f018 100644 --- a/test/unit/pixi/loaders/BitmapFontLoader.js +++ b/test/unit/pixi/loaders/BitmapFontLoader.js @@ -2,7 +2,6 @@ 'use strict'; var expect = chai.expect; - var BitmapFontLoader = PIXI.BitmapFontLoader; it('Module exists', function () { expect(PIXI.BitmapFontLoader).to.be.a('function'); diff --git a/test/unit/pixi/utils/EventTarget.js b/test/unit/pixi/utils/EventTarget.js index dc4ebd9..67c6ad1 100644 --- a/test/unit/pixi/utils/EventTarget.js +++ b/test/unit/pixi/utils/EventTarget.js @@ -9,13 +9,17 @@ }); it('Confirm new instance', function () { - var obj = {}; EventTarget.call(obj); + var obj = {}; + + EventTarget.call(obj); pixi_utils_EventTarget_like(obj); }); it('addEventListener and dispatchEvent works', function (done) { var myData = {}, - obj = {}; EventTarget.call(obj); + obj = {}; + + EventTarget.call(obj); obj.addEventListener('myevent', function (event) { expect(event).to.be.an('object'); @@ -28,7 +32,9 @@ }); it('removeEventListener works', function (done) { - var obj = {}; EventTarget.call(obj); + var obj = {}; + + EventTarget.call(obj); function onMyEvent() { done(new Error('addEventListener should not have been called')); @@ -42,7 +48,9 @@ it('multiple dispatches', function () { var called = 0, - obj = {}; EventTarget.call(obj); + obj = {}; + + EventTarget.call(obj); function onMyEvent() { called++; @@ -58,7 +66,9 @@ it('multiple events', function () { var called = 0, - obj = {}; EventTarget.call(obj); + obj = {}; + + EventTarget.call(obj); function onMyEvent() { called++; @@ -75,7 +85,9 @@ it('multiple events one removed', function () { var called = 0, - obj = {}; EventTarget.call(obj); + obj = {}; + + EventTarget.call(obj); function onMyEvent() { called++;