mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
test(vim) coverage
This commit is contained in:
parent
aacb1af6b5
commit
01a09a5f90
2 changed files with 8 additions and 6 deletions
|
|
@ -9,9 +9,7 @@ const {
|
|||
getDOM,
|
||||
} = require('./globals.fixture');
|
||||
|
||||
global.DOM = global.DOM || getDOM();
|
||||
|
||||
const DOM = global.DOM;
|
||||
global.DOM = getDOM();
|
||||
|
||||
const {
|
||||
find,
|
||||
|
|
@ -22,7 +20,9 @@ const {
|
|||
} = require(dir + 'find');
|
||||
|
||||
test('cloudcmd: client: vim: find', (t) => {
|
||||
const {DOM} = global;
|
||||
const setCurrentByName = sinon.stub();
|
||||
|
||||
DOM.setCurrentByName = setCurrentByName;
|
||||
DOM.Dialog.prompt = Promise.resolve.bind(Promise);
|
||||
|
||||
|
|
@ -33,6 +33,7 @@ test('cloudcmd: client: vim: find', (t) => {
|
|||
});
|
||||
|
||||
test('cloudcmd: client: vim: findNext', (t) => {
|
||||
const {DOM} = global;
|
||||
const setCurrentByName = sinon.stub();
|
||||
DOM.setCurrentByName = setCurrentByName;
|
||||
|
||||
|
|
@ -43,9 +44,10 @@ test('cloudcmd: client: vim: findNext', (t) => {
|
|||
});
|
||||
|
||||
test('cloudcmd: client: vim: findPrevious', (t) => {
|
||||
const {DOM} = global;
|
||||
const setCurrentByName = sinon.stub();
|
||||
DOM.setCurrentByName = setCurrentByName;
|
||||
|
||||
DOM.setCurrentByName = setCurrentByName;
|
||||
findPrevious();
|
||||
|
||||
t.ok(setCurrentByName.calledWith(null), 'should call setCurrentByName');
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ const {
|
|||
getCloudCmd,
|
||||
} = require('./globals.fixture');
|
||||
|
||||
global.DOM = global.DOM || getDOM();
|
||||
global.CloudCmd = global.CloudCmd || getCloudCmd();
|
||||
global.DOM = getDOM();
|
||||
global.CloudCmd = getCloudCmd();
|
||||
|
||||
const DOM = global.DOM;
|
||||
const Buffer = DOM.Buffer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue