mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
test(cloudfunc) add html-looks-like
This commit is contained in:
parent
905876f865
commit
67b5cae29f
2 changed files with 41 additions and 36 deletions
|
|
@ -165,6 +165,7 @@
|
|||
"es6-promisify": "^5.0.0",
|
||||
"eslint": "^3.1.1",
|
||||
"gunzip-maybe": "^1.3.1",
|
||||
"html-looks-like": "^1.0.2",
|
||||
"jscs": "^3.0.1",
|
||||
"jshint": "^2.8.0",
|
||||
"minor": "^1.2.2",
|
||||
|
|
|
|||
|
|
@ -1,41 +1,42 @@
|
|||
'use strict';
|
||||
|
||||
const DIR = __dirname + '/../../',
|
||||
COMMONDIR = DIR + 'common/',
|
||||
TMPLDIR = DIR + 'tmpl/',
|
||||
|
||||
Util = require(COMMONDIR + 'util'),
|
||||
CloudFunc = require(COMMONDIR + 'cloudfunc'),
|
||||
files = require('files-io'),
|
||||
|
||||
test = require('tape'),
|
||||
|
||||
FS_DIR = TMPLDIR + 'fs/',
|
||||
EXPECT_PATH = __dirname + '/cloudfunc.html',
|
||||
|
||||
TMPL_PATH = [
|
||||
'file',
|
||||
'path',
|
||||
'pathLink',
|
||||
'link',
|
||||
],
|
||||
|
||||
JSON_FILES = {
|
||||
path : '/etc/X11/',
|
||||
files : [{
|
||||
name: 'applnk',
|
||||
size: 'dir',
|
||||
date: '21.02.2016',
|
||||
uid : 0,
|
||||
mode: 'rwx r-x r-x'
|
||||
}, {
|
||||
name: 'prefdm',
|
||||
size: '1.30kb',
|
||||
date: '21.02.2016',
|
||||
uid : 0,
|
||||
mode: 'rwx r-x r-x'
|
||||
}]
|
||||
};
|
||||
const DIR = __dirname + '/../../';
|
||||
const COMMONDIR = DIR + 'common/';
|
||||
const TMPLDIR = DIR + 'tmpl/';
|
||||
|
||||
const Util = require(COMMONDIR + 'util');
|
||||
const CloudFunc = require(COMMONDIR + 'cloudfunc');
|
||||
const files = require('files-io');
|
||||
|
||||
const test = require('tape');
|
||||
const htmlLooksLike = require('html-looks-like');
|
||||
|
||||
const FS_DIR = TMPLDIR + 'fs/';
|
||||
const EXPECT_PATH = __dirname + '/cloudfunc.html';
|
||||
|
||||
const TMPL_PATH = [
|
||||
'file',
|
||||
'path',
|
||||
'pathLink',
|
||||
'link',
|
||||
];
|
||||
|
||||
const JSON_FILES = {
|
||||
path : '/etc/X11/',
|
||||
files : [{
|
||||
name: 'applnk',
|
||||
size: 'dir',
|
||||
date: '21.02.2016',
|
||||
uid : 0,
|
||||
mode: 'rwx r-x r-x'
|
||||
}, {
|
||||
name: 'prefdm',
|
||||
size: '1.30kb',
|
||||
date: '21.02.2016',
|
||||
uid : 0,
|
||||
mode: 'rwx r-x r-x'
|
||||
}]
|
||||
};
|
||||
|
||||
let Expect =
|
||||
'<div data-name="js-path" class="reduce-text" title="/etc/X11/">' +
|
||||
|
|
@ -114,6 +115,9 @@ test('render', (t) => {
|
|||
}
|
||||
|
||||
t.equal(Expect, result, 'should be equal rendered json data');
|
||||
|
||||
htmlLooksLike(Expect, result);
|
||||
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue