mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 00:59:03 +01:00
don't check for number of documents, https://github.com/microsoft/vscode/issues/100842
This commit is contained in:
@@ -61,11 +61,18 @@ suite('vscode API - workspace', () => {
|
||||
});
|
||||
|
||||
test('openTextDocument', async () => {
|
||||
const len = vscode.workspace.textDocuments.length;
|
||||
const uri = await createRandomFile();
|
||||
|
||||
// not yet there
|
||||
const existing1 = vscode.workspace.textDocuments.find(doc => doc.uri.toString() === uri.toString());
|
||||
assert.equal(existing1, undefined);
|
||||
|
||||
// open and assert its there
|
||||
const doc = await vscode.workspace.openTextDocument(uri);
|
||||
assert.ok(doc);
|
||||
assert.equal(vscode.workspace.textDocuments.length, len + 1);
|
||||
assert.equal(doc.uri.toString(), uri.toString());
|
||||
const existing2 = vscode.workspace.textDocuments.find(doc => doc.uri.toString() === uri.toString());
|
||||
assert.equal(existing2 === doc, true);
|
||||
});
|
||||
|
||||
test('openTextDocument, illegal path', () => {
|
||||
|
||||
Reference in New Issue
Block a user