feature(cloudcmd) move out dist from route

This commit is contained in:
coderaiser 2018-05-11 13:03:58 +03:00
parent bb44a14780
commit 4e99372e6f
6 changed files with 94 additions and 163 deletions

View file

@ -1,5 +1,7 @@
'use strict';
const path = require('path');
const test = require('tape');
const diff = require('sinon-called-with-diff');
const sinon = diff(require('sinon'));
@ -201,6 +203,23 @@ function credentials() {
return set(reset);
}
test('cloudcmd: getIndexPath: production', (t) => {
const isDev = false;
const name = path.join(__dirname, '..', '..', 'dist', 'index.html');
t.equal(cloudcmd._getIndexPath(isDev), name);
t.end();
});
test('cloudcmd: getIndexPath: development', (t) => {
const isDev = true;
const name = path.join(__dirname, '..', '..', 'dist-dev', 'index.html');
t.equal(cloudcmd._getIndexPath(isDev), name);
t.end();
});
function cleanNodeEnv() {
const {NODE_ENV} = process.env;
process.env.NODE_ENV = '';