test(cloudfunc) getTitle

This commit is contained in:
coderaiser 2017-07-26 14:26:45 +03:00
parent 98de9c6bfd
commit 9c16e62deb
2 changed files with 13 additions and 0 deletions

View file

@ -165,6 +165,7 @@
"eslint-plugin-node": "^5.1.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.11.2",
"fresh-require": "^1.0.3",
"gunzip-maybe": "^1.3.1",
"html-looks-like": "^1.0.2",
"html-webpack-exclude-assets-plugin": "^0.0.5",

View file

@ -6,9 +6,15 @@ const TMPLDIR = DIR + 'tmpl/';
const Util = require(COMMONDIR + 'util');
const CloudFunc = require(COMMONDIR + 'cloudfunc');
const files = require('files-io');
const currify = require('currify');
const swap = currify((fn, a, b) => fn(b, a));
const test = require('tape');
const fresh = swap(require('fresh-require'), require);
const htmlLooksLike = require('html-looks-like');
const FS_DIR = TMPLDIR + 'fs/';
@ -145,6 +151,9 @@ test('cloudfunc: formatMsg', (t) => {
});
test('cloudfunc: getTitle', (t) => {
const name = COMMONDIR + 'cloudfunc';
const CloudFunc = fresh(name);
const result = CloudFunc.getTitle();
t.equal(result, 'Cloud Commander - /');
@ -152,6 +161,9 @@ test('cloudfunc: getTitle', (t) => {
});
test('cloudfunc: getTitle', (t) => {
const name = COMMONDIR + 'cloudfunc';
const CloudFunc = fresh(name);
const result = CloudFunc.getTitle('/hello/world');
t.equal(result, 'Cloud Commander - /hello/world');