Skip to content

Commit

Permalink
use different port for test server, fix test precision limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Aug 4, 2015
1 parent 352bfd6 commit c1f71b9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions Gruntfile.js
Expand Up @@ -69,7 +69,7 @@ module.exports = function(grunt) {
},
serve: {
options: {
port: 9000
port: 8000
}
}
},
Expand Down Expand Up @@ -139,8 +139,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-shell');

grunt.registerTask('default', ['test', 'build']);
grunt.registerTask('test', ['jshint', 'test:demo']);
grunt.registerTask('test:all', ['build:dev', 'connect:serve', 'test']);
grunt.registerTask('test', ['build:dev', 'connect:serve', 'jshint', 'test:demo']);
grunt.registerTask('dev', ['build:dev', 'connect:watch', 'watch']);

grunt.registerTask('test:demo', function() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -34,7 +34,7 @@
},
"scripts": {
"dev": "npm install && grunt dev",
"test": "grunt test:all"
"test": "grunt test"
},
"dependencies": {}
}
6 changes: 4 additions & 2 deletions test/browser/TestDemo.js
Expand Up @@ -6,7 +6,7 @@ var system = require('system');

var demo,
frames = 10,
testUrl = 'http://localhost:9000/demo/dev.html',
testUrl = 'http://localhost:8000/demo/dev.html',
refsPath = 'test/browser/refs',
diffsPath = 'test/browser/diffs';

Expand Down Expand Up @@ -71,6 +71,9 @@ var test = function(status) {
return engine.world;
}, demo, frames);

worldEnd = resurrect.resurrect(resurrect.stringify(worldEnd, precisionLimiter));
worldStart = resurrect.resurrect(resurrect.stringify(worldStart, precisionLimiter));

if (fs.exists(worldStartPath)) {
var worldStartRef = resurrect.resurrect(fs.read(worldStartPath));
var worldStartDiff = compare(worldStartRef, worldStart);
Expand Down Expand Up @@ -145,7 +148,6 @@ var test = function(status) {
};

var precisionLimiter = function(key, value) {
// limit precision of floats
if (typeof value === 'number') {
return parseFloat(value.toFixed(5));
}
Expand Down

0 comments on commit c1f71b9

Please sign in to comment.