Skip to content

Commit 5f3785c

Browse files
committed
avoid registration
1 parent 0dcefdc commit 5f3785c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

lib/API/Keymetrics/cli-api.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ module.exports = function(CLI) {
5454
CLI.prototype.monitorState = function(state, target, cb) {
5555
var that = this;
5656

57-
try {
58-
fs.statSync(this._conf.INTERACTION_CONF);
59-
} catch(e) {
60-
printMotd();
61-
return registerPrompt();
57+
if (process.env.NODE_ENV !== 'test') {
58+
try {
59+
fs.statSync(this._conf.INTERACTION_CONF);
60+
} catch(e) {
61+
printMotd();
62+
return registerPrompt();
63+
}
6264
}
6365

6466
if (!target) {

test/interface/monitor.mocha.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* eslint-env mocha */
22

3+
process.env.NODE_ENV='test';
4+
35
'use strict';
46

57
var pm2 = require('../../index.js');

0 commit comments

Comments
 (0)