Trigger test mode by checking NODE_ENV

Adds CYLON_TEST var for tests to make sure tests run properly
This commit is contained in:
Andrew Stewart 2014-09-22 15:04:11 -07:00
parent e91bc57de0
commit 6fa67f0e3b
2 changed files with 4 additions and 3 deletions

View File

@ -348,7 +348,7 @@ Robot.prototype.initAdaptor = function(adaptorName, connection, opts) {
extraParams: opts
});
if (Config.test_mode) {
if (process.env.NODE_ENV === 'test' && !CYLON_TEST) {
var testAdaptor = this.requireAdaptor('test').adaptor({
name: adaptorName,
connection: connection,
@ -421,7 +421,7 @@ Robot.prototype.initDriver = function(driverName, device, opts) {
extraParams: opts
});
if (Config.test_mode) {
if (process.env.NODE_ENV === 'test' && !CYLON_TEST) {
var testDriver = this.requireDriver('test').driver({
name: driverName,
device: device,

View File

@ -1,6 +1,7 @@
'use strict';
process.env.NODE_ENV = 'test';
global.CYLON_TEST = true;
var path = require('path');
@ -29,7 +30,7 @@ global.source = function(module) {
var Cylon = source('cylon');
Cylon.config({
mode: "manual"
mode: "manual",
});
Cylon.Logger.setup(false);