mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
test(package) gritty: terminal enabled
This commit is contained in:
parent
9c18764178
commit
9b2c276036
4 changed files with 22 additions and 6 deletions
|
|
@ -243,7 +243,7 @@ test('cloudcmd: route: sendIndex: encode', async (t) => {
|
|||
|
||||
t.ok(data.includes(nameEncoded), 'should encode name');
|
||||
|
||||
clear('flop');
|
||||
mockRequire.stop('flop');
|
||||
clear(routePath);
|
||||
clear('../../server/cloudcmd');
|
||||
clear(beforePath);
|
||||
|
|
@ -277,7 +277,7 @@ test('cloudcmd: route: sendIndex: encode: not encoded', async (t) => {
|
|||
|
||||
t.notOk(data.includes(name), 'should not put not encoded name');
|
||||
|
||||
clear('flop');
|
||||
mockRequire.stop('flop');
|
||||
clear(routePath);
|
||||
clear('../../server/cloudcmd');
|
||||
clear(beforePath);
|
||||
|
|
@ -312,7 +312,7 @@ test('cloudcmd: route: sendIndex: ddos: render', async (t) => {
|
|||
|
||||
t.pass('should not hang up');
|
||||
|
||||
clear('flop');
|
||||
mockRequire.stop('flo');
|
||||
clear(routePath);
|
||||
clear(cloudcmdPath);
|
||||
clear(beforePath);
|
||||
|
|
@ -335,3 +335,18 @@ test('cloudcmd: route: buttons: no terminal', async (t) => {
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('cloudcmd: route: buttons: terminal', async (t) => {
|
||||
const config = {
|
||||
terminal: true,
|
||||
terminalPath: 'gritty',
|
||||
};
|
||||
|
||||
const {port, done} = await connect({config});
|
||||
const result = await getStr(`http://localhost:${port}`);
|
||||
|
||||
t.notOk(/icon-terminal none/.test(result), 'should enable terminal');
|
||||
|
||||
done();
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -97,6 +97,8 @@ test('cloudcmd: terminal: no arg', (t) => {
|
|||
|
||||
t.equal(result, gritty, 'should equal');
|
||||
|
||||
mock.stop('gritty');
|
||||
|
||||
clean(configPath);
|
||||
require(configPath);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue