diff --git a/lib/robot.js b/lib/robot.js index 2699781..35959ef 100644 --- a/lib/robot.js +++ b/lib/robot.js @@ -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, diff --git a/test/support/env.js b/test/support/env.js index 15d5f12..60a5928 100644 --- a/test/support/env.js +++ b/test/support/env.js @@ -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);