mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
test(cloudcmd) deprecate: one panel mode
This commit is contained in:
parent
24ef843b65
commit
cdc7fed69c
1 changed files with 27 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const util = require('util');
|
||||
|
||||
const test = require('tape');
|
||||
const diff = require('sinon-called-with-diff');
|
||||
|
|
@ -11,6 +12,8 @@ const clean = require('clear-module');
|
|||
const DIR = '../../server/';
|
||||
const cloudcmdPath = DIR + 'cloudcmd';
|
||||
|
||||
const noop = () => {};
|
||||
|
||||
const cloudcmd = require(cloudcmdPath);
|
||||
const config = require(DIR + 'config');
|
||||
const {
|
||||
|
|
@ -219,6 +222,30 @@ test('cloudcmd: getIndexPath: development', (t) => {
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('cloudcmd: deprecated: one panel mode', (t) => {
|
||||
const config = {
|
||||
onePanelMode: true
|
||||
};
|
||||
|
||||
const {
|
||||
deprecate: originalDeprecate
|
||||
} = util;
|
||||
|
||||
const deprecate = sinon
|
||||
.stub()
|
||||
.returns(noop);
|
||||
|
||||
util.deprecate = deprecate;
|
||||
|
||||
cloudcmd({
|
||||
config
|
||||
});
|
||||
|
||||
util.deprecate = originalDeprecate;
|
||||
|
||||
t.ok(deprecate.called, 'should call deprecate');
|
||||
t.end();
|
||||
});
|
||||
|
||||
function cleanNodeEnv() {
|
||||
const {NODE_ENV} = process.env;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue