mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 09:08:53 +01:00
more stable integration test: onDidOpenNotebookDocument
This commit is contained in:
@@ -411,12 +411,14 @@ suite('Notebook Document', function () {
|
||||
});
|
||||
|
||||
test('onDidOpenNotebookDocument - emit event only once when opened in two editors', async function () {
|
||||
const uri = await utils.createRandomFile(undefined, undefined, '.nbdtest');
|
||||
let counter = 0;
|
||||
testDisposables.push(vscode.workspace.onDidOpenNotebookDocument(() => {
|
||||
counter++;
|
||||
testDisposables.push(vscode.workspace.onDidOpenNotebookDocument(nb => {
|
||||
if (uri.toString() === nb.uri.toString()) {
|
||||
counter++;
|
||||
}
|
||||
}));
|
||||
|
||||
const uri = await utils.createRandomFile(undefined, undefined, '.nbdtest');
|
||||
const notebook = await vscode.workspace.openNotebookDocument(uri);
|
||||
assert.strictEqual(counter, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user