From 2fcb0b0d9c6029f6dc71bb10b2206c1d1aa60198 Mon Sep 17 00:00:00 2001 From: einaros Date: Mon, 2 Jan 2012 16:32:20 +0100 Subject: [PATCH] cleanup and addition of test command --- make.bat | 25 ++++++++++++++++++++----- package.json | 2 +- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/make.bat b/make.bat index 772ddebbc..d8795d61b 100644 --- a/make.bat +++ b/make.bat @@ -1,5 +1,20 @@ -REM This file hijacks the make command from package.json, so that -REM the solution can be 'built' on Windows. -mkdir build\Release -xcopy /Y lib\ValidationWindows.js build\Release\validation.js -xcopy /Y lib\BufferUtilWindows.js build\Release\bufferutil.js +@echo off + +REM This file hijacks the make command from package.json, so that +REM the solution can be 'built' on Windows. + +IF "%1"=="" GOTO Build +IF "%1"=="test" goto Test +GOTO End + +:Build +mkdir build\Release +copy /Y lib\ValidationWindows.js build\Release\validation.js +copy /Y lib\BufferUtilWindows.js build\Release\bufferutil.js +GOTO End + +:Test +node node_modules/mocha/bin/_mocha -t 2000 test/BufferPool.test.js test/Sender.test.js test/WebSocketServer.test.js test/Receiver.test.js test/Validation.test.js test/WebSocket.test.js + +:End + diff --git a/package.json b/package.json index c53f1871c..dc5aaa50a 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "wscat": "./bin/wscat" }, "scripts": { - "test": "./node_modules/.bin/mocha -t 2000 test/*.test.*", + "test": "make test", "preinstall": "make" }, "engines": {