提交 ed0803e6 编写于 作者: R rebornix

fix false negative tests

上级 b1c870fe
......@@ -8,6 +8,14 @@ import * as assert from 'assert';
import * as vscode from 'vscode';
import { join } from 'path';
export function timeoutAsync(n: number): Promise<void> {
return new Promise(resolve => {
setTimeout(() => {
resolve();
}, n);
});
}
export function once<T>(event: vscode.Event<T>): vscode.Event<T> {
return (listener: any, thisArgs = null, disposables?: any) => {
// we need this, in case the event fires during the listener call
......@@ -103,14 +111,14 @@ suite('API tests', () => {
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
assert.equal(count, 1);
await vscode.commands.executeCommand('workbench.action.splitEditor');
await splitEditor();
assert.equal(count, 2);
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
assert.equal(count, 0);
});
test('editor editing event', async function () {
test('editor editing event 2', async function () {
const resource = vscode.Uri.parse(join(vscode.workspace.rootPath || '', './first.vsctestnb'));
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册