From bd95f9eb3c852c3916ea5545f1d7feef746df229 Mon Sep 17 00:00:00 2001 From: Andrew Stewart Date: Mon, 20 Oct 2014 14:55:25 -0700 Subject: [PATCH] Reorganize tests, under 'spec' directory now --- Makefile | 2 +- test/support/env.js => spec/helper.js | 2 +- {test/specs => spec/lib}/adaptor.spec.js | 0 {test/specs => spec/lib}/api.spec.js | 0 {test/specs => spec/lib}/api/auth/basic.spec.js | 0 {test/specs => spec/lib}/api/routes.spec.js | 0 {test/specs => spec/lib}/basestar.spec.js | 0 {test/specs => spec/lib}/connection.spec.js | 0 {test/specs => spec/lib}/cylon.spec.js | 0 {test/specs => spec/lib}/device.spec.js | 0 {test/specs => spec/lib}/digital-pin.spec.js | 0 {test/specs => spec/lib}/driver.spec.js | 0 {test/specs => spec/lib}/io/utils.js | 0 {test/specs => spec/lib}/logger.spec.js | 0 {test/specs => spec/lib}/logger/basic_logger.spec.js | 0 {test/specs => spec/lib}/robot.spec.js | 0 {test/specs => spec/lib}/utils.spec.js | 0 {test => spec}/support/mock_request.js | 0 {test => spec}/support/mock_response.js | 0 19 files changed, 2 insertions(+), 2 deletions(-) rename test/support/env.js => spec/helper.js (91%) rename {test/specs => spec/lib}/adaptor.spec.js (100%) rename {test/specs => spec/lib}/api.spec.js (100%) rename {test/specs => spec/lib}/api/auth/basic.spec.js (100%) rename {test/specs => spec/lib}/api/routes.spec.js (100%) rename {test/specs => spec/lib}/basestar.spec.js (100%) rename {test/specs => spec/lib}/connection.spec.js (100%) rename {test/specs => spec/lib}/cylon.spec.js (100%) rename {test/specs => spec/lib}/device.spec.js (100%) rename {test/specs => spec/lib}/digital-pin.spec.js (100%) rename {test/specs => spec/lib}/driver.spec.js (100%) rename {test/specs => spec/lib}/io/utils.js (100%) rename {test/specs => spec/lib}/logger.spec.js (100%) rename {test/specs => spec/lib}/logger/basic_logger.spec.js (100%) rename {test/specs => spec/lib}/robot.spec.js (100%) rename {test/specs => spec/lib}/utils.spec.js (100%) rename {test => spec}/support/mock_request.js (100%) rename {test => spec}/support/mock_response.js (100%) diff --git a/Makefile b/Makefile index f27244a..0495e84 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ BIN := ./node_modules/.bin -TEST_FILES := test/support/env.js $(shell find test/specs -type f -name "*.js") +TEST_FILES := spec/helper.js $(shell find spec/lib -type f -name "*.js") VERSION := $(shell node -e "console.log(require('./package.json').version)") diff --git a/test/support/env.js b/spec/helper.js similarity index 91% rename from test/support/env.js rename to spec/helper.js index 60a5928..0008e29 100644 --- a/test/support/env.js +++ b/spec/helper.js @@ -24,7 +24,7 @@ global.stub = sinon.stub; // convenience function to require modules in lib directory global.source = function(module) { - return require(path.normalize('./../../lib/' + module)); + return require(path.normalize('./../lib/' + module)); }; var Cylon = source('cylon'); diff --git a/test/specs/adaptor.spec.js b/spec/lib/adaptor.spec.js similarity index 100% rename from test/specs/adaptor.spec.js rename to spec/lib/adaptor.spec.js diff --git a/test/specs/api.spec.js b/spec/lib/api.spec.js similarity index 100% rename from test/specs/api.spec.js rename to spec/lib/api.spec.js diff --git a/test/specs/api/auth/basic.spec.js b/spec/lib/api/auth/basic.spec.js similarity index 100% rename from test/specs/api/auth/basic.spec.js rename to spec/lib/api/auth/basic.spec.js diff --git a/test/specs/api/routes.spec.js b/spec/lib/api/routes.spec.js similarity index 100% rename from test/specs/api/routes.spec.js rename to spec/lib/api/routes.spec.js diff --git a/test/specs/basestar.spec.js b/spec/lib/basestar.spec.js similarity index 100% rename from test/specs/basestar.spec.js rename to spec/lib/basestar.spec.js diff --git a/test/specs/connection.spec.js b/spec/lib/connection.spec.js similarity index 100% rename from test/specs/connection.spec.js rename to spec/lib/connection.spec.js diff --git a/test/specs/cylon.spec.js b/spec/lib/cylon.spec.js similarity index 100% rename from test/specs/cylon.spec.js rename to spec/lib/cylon.spec.js diff --git a/test/specs/device.spec.js b/spec/lib/device.spec.js similarity index 100% rename from test/specs/device.spec.js rename to spec/lib/device.spec.js diff --git a/test/specs/digital-pin.spec.js b/spec/lib/digital-pin.spec.js similarity index 100% rename from test/specs/digital-pin.spec.js rename to spec/lib/digital-pin.spec.js diff --git a/test/specs/driver.spec.js b/spec/lib/driver.spec.js similarity index 100% rename from test/specs/driver.spec.js rename to spec/lib/driver.spec.js diff --git a/test/specs/io/utils.js b/spec/lib/io/utils.js similarity index 100% rename from test/specs/io/utils.js rename to spec/lib/io/utils.js diff --git a/test/specs/logger.spec.js b/spec/lib/logger.spec.js similarity index 100% rename from test/specs/logger.spec.js rename to spec/lib/logger.spec.js diff --git a/test/specs/logger/basic_logger.spec.js b/spec/lib/logger/basic_logger.spec.js similarity index 100% rename from test/specs/logger/basic_logger.spec.js rename to spec/lib/logger/basic_logger.spec.js diff --git a/test/specs/robot.spec.js b/spec/lib/robot.spec.js similarity index 100% rename from test/specs/robot.spec.js rename to spec/lib/robot.spec.js diff --git a/test/specs/utils.spec.js b/spec/lib/utils.spec.js similarity index 100% rename from test/specs/utils.spec.js rename to spec/lib/utils.spec.js diff --git a/test/support/mock_request.js b/spec/support/mock_request.js similarity index 100% rename from test/support/mock_request.js rename to spec/support/mock_request.js diff --git a/test/support/mock_response.js b/spec/support/mock_response.js similarity index 100% rename from test/support/mock_response.js rename to spec/support/mock_response.js