mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
chore(cloudcmd) lint
This commit is contained in:
parent
bd5a8afdd5
commit
efb686c332
12 changed files with 43 additions and 29 deletions
|
|
@ -4,6 +4,8 @@ const test = require('supertape');
|
|||
const mockRequire = require('mock-require');
|
||||
const stub = require('@cloudcmd/stub');
|
||||
|
||||
const {stopAll} = mockRequire;
|
||||
|
||||
test('cloudcmd: client: polyfill: scrollIntoViewIfNeaded', (t) => {
|
||||
const {DOM} = global;
|
||||
const scroll = stub();
|
||||
|
|
@ -26,6 +28,8 @@ test('cloudcmd: client: polyfill: scrollIntoViewIfNeaded', (t) => {
|
|||
block: 'nearest',
|
||||
}];
|
||||
|
||||
stopAll();
|
||||
|
||||
t.calledWith(scroll, args, 'should call scrollIntoViewIfNeaded');
|
||||
t.end();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const autoGlobals = require('auto-globals');
|
|||
const test = autoGlobals(require('supertape'));
|
||||
const stub = require('@cloudcmd/stub');
|
||||
const mockRequire = require('mock-require');
|
||||
const {reRequire} = mockRequire;
|
||||
const {reRequire, stopAll} = mockRequire;
|
||||
|
||||
test('cloudcmd: client: view: initConfig', (t) => {
|
||||
let config;
|
||||
|
|
@ -78,6 +78,8 @@ test('cloudcmd: client: view: html', (t) => {
|
|||
const [first] = open.args;
|
||||
const [arg] = first;
|
||||
|
||||
stopAll();
|
||||
|
||||
t.deepEqual(first, [arg, _Config]);
|
||||
t.end();
|
||||
});
|
||||
|
|
@ -101,6 +103,8 @@ test('cloudcmd: client: view: createIframe', (t) => {
|
|||
width: '100%',
|
||||
};
|
||||
|
||||
stopAll();
|
||||
|
||||
t.calledWith(createElement, ['iframe', expected]);
|
||||
t.end();
|
||||
});
|
||||
|
|
@ -118,6 +122,8 @@ test('cloudcmd: client: view: createIframe: returns', (t) => {
|
|||
const src = '/hello.html';
|
||||
const result = _createIframe(src);
|
||||
|
||||
stopAll();
|
||||
|
||||
t.equal(result, el);
|
||||
t.end();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue