0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-01-10 15:50:44 -05:00

use different port for test server, fix test precision limiter

This commit is contained in:
liabru 2015-08-05 00:02:52 +01:00
parent 352bfd62b3
commit c1f71b993c
3 changed files with 7 additions and 6 deletions

View file

@ -69,7 +69,7 @@ module.exports = function(grunt) {
},
serve: {
options: {
port: 9000
port: 8000
}
}
},
@ -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() {

View file

@ -34,7 +34,7 @@
},
"scripts": {
"dev": "npm install && grunt dev",
"test": "grunt test:all"
"test": "grunt test"
},
"dependencies": {}
}

View file

@ -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';
@ -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);
@ -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));
}