Trigger test mode by checking NODE_ENV
Adds CYLON_TEST var for tests to make sure tests run properly
This commit is contained in:
parent
e91bc57de0
commit
6fa67f0e3b
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue