Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test execution on Chrome browser. Updated grunt, grunt plugins. Fixed new ESLint warning. #890

Merged
merged 2 commits into from
Jul 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,13 @@ module.exports = function (grunt) {
pull : true
}
}
},

karma: {
unit: {
configFile: "karma.conf.js"
}
}
});

grunt.loadNpmTasks("grunt-contrib-clean");
Expand All @@ -253,6 +259,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-build-gh-pages");
grunt.loadNpmTasks("grunt-jsdoc");
grunt.loadNpmTasks("grunt-karma");
grunt.loadNpmTasks("grunt-replace");

// Custom Tasks
Expand All @@ -271,6 +278,7 @@ module.exports = function (grunt) {
]);
grunt.registerTask("doc", [ "replace:docs", "jsdoc" ]);
grunt.registerTask("test", [ "lint", "connect:server", "jasmine" ]);
grunt.registerTask("testChrome", [ "karma" ]);
grunt.registerTask("serve", [ "connect:keepalive" ]);
grunt.registerTask("gh-pages", [
"test",
Expand Down
25 changes: 25 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = function(config) {

var sourceFiles = require("./sourceFiles.json");
var testSpecs = require("./testSpecs.json");

var files = sourceFiles.concat("tests/spec/helper-spec.js").concat(testSpecs);
var files = files.concat([{pattern: 'tests/data/**/*', watched: false, included: false, served: true}]);


config.set({

basePath: '',

//test framework would be jasmine however other frameworks can be used
frameworks: ['jasmine'],
//all js files needed for tests to run order matters! e.g. do not load angular mocks before angular ect...
files: files,

browsers: ['Chrome'], // You may use 'ChromeCanary', 'Chromium' or any other supported browser
proxies: {
"/tests/": "/base/tests/"
}
// you can define custom flags
})
}
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,23 @@
"dependencies": {},
"devDependencies": {
"dot": "git+/~https://github.com/parasyte/doT.git#bug/replace-ext",
"grunt": "^0.4.5",
"grunt": "^1.0.1",
"grunt-build-gh-pages": "^1.0.5",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-jasmine": "^1.0.3",
"grunt-eslint": "^19.0.0",
"grunt-contrib-uglify": "^1.0.1",
"grunt-jsdoc": "^1.1.0",
"grunt-contrib-jasmine": "^1.1.0",
"grunt-eslint": "^20.0.0",
"grunt-contrib-uglify": "^3.0.1",
"grunt-jsdoc": "^2.1.0",
"grunt-karma": "^2.0.0",
"grunt-replace": "^1.0.1",
"grunt-shell": "^2.1.0",
"karma-chrome-launcher": "2.2.0",
"jasmine-core": "~2.5.2",
"karma": "^1.7.0",
"karma-jasmine": "^1.1.0",
"q": "^1.4.1",
"shelljs": "^0.5.3"
},
Expand Down
2 changes: 1 addition & 1 deletion src/renderable/renderable.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
if (typeof (alpha) === "number") {
this.alpha = alpha.clamp(0.0, 1.0);
// Set to 1 if alpha is NaN
if (this.alpha !== this.alpha) {
if (isNaN(this.alpha)) {
this.alpha = 1.0;
}
}
Expand Down