From c1f71b993c8bc09a0abe702108e67fa29e7037e8 Mon Sep 17 00:00:00 2001 From: liabru Date: Wed, 5 Aug 2015 00:02:52 +0100 Subject: [PATCH] use different port for test server, fix test precision limiter --- Gruntfile.js | 5 ++--- package.json | 2 +- test/browser/TestDemo.js | 6 ++++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 6d217a0..4fccedc 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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() { diff --git a/package.json b/package.json index 51fe18d..20b9a7b 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ }, "scripts": { "dev": "npm install && grunt dev", - "test": "grunt test:all" + "test": "grunt test" }, "dependencies": {} } diff --git a/test/browser/TestDemo.js b/test/browser/TestDemo.js index df72418..8603e45 100644 --- a/test/browser/TestDemo.js +++ b/test/browser/TestDemo.js @@ -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)); }