mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 17:04:16 +00:00
feature(cloudcmd) move out dist from route
This commit is contained in:
parent
bb44a14780
commit
4e99372e6f
6 changed files with 94 additions and 163 deletions
|
|
@ -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 = '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue