From cdc7fed69c3857970d80ac3a77f3917d16ea96c2 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 11 May 2018 18:08:06 +0300 Subject: [PATCH] test(cloudcmd) deprecate: one panel mode --- test/server/cloudcmd.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/server/cloudcmd.js b/test/server/cloudcmd.js index 852c2b93..79c83ef3 100644 --- a/test/server/cloudcmd.js +++ b/test/server/cloudcmd.js @@ -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;