mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 17:19:01 +01:00
more verbose integration test failures
This commit is contained in:
@@ -245,6 +245,10 @@ suite('workspace-namespace', () => {
|
||||
sub.dispose();
|
||||
});
|
||||
|
||||
function assertEqualPath(a: string, b: string): void {
|
||||
assert.ok(pathEquals(a, b), `${a} <-> ${b}`);
|
||||
}
|
||||
|
||||
test('events: onDidOpenTextDocument, onDidChangeTextDocument, onDidSaveTextDocument', async () => {
|
||||
const file = await createRandomFile();
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
@@ -252,19 +256,19 @@ suite('workspace-namespace', () => {
|
||||
let pendingAsserts: Function[] = [];
|
||||
let onDidOpenTextDocument = false;
|
||||
disposables.push(vscode.workspace.onDidOpenTextDocument(e => {
|
||||
pendingAsserts.push(() => assert.ok(pathEquals(e.uri.fsPath, file.fsPath)));
|
||||
pendingAsserts.push(() => assertEqualPath(e.uri.fsPath, file.fsPath));
|
||||
onDidOpenTextDocument = true;
|
||||
}));
|
||||
|
||||
let onDidChangeTextDocument = false;
|
||||
disposables.push(vscode.workspace.onDidChangeTextDocument(e => {
|
||||
pendingAsserts.push(() => assert.ok(pathEquals(e.document.uri.fsPath, file.fsPath)));
|
||||
pendingAsserts.push(() => assertEqualPath(e.document.uri.fsPath, file.fsPath));
|
||||
onDidChangeTextDocument = true;
|
||||
}));
|
||||
|
||||
let onDidSaveTextDocument = false;
|
||||
disposables.push(vscode.workspace.onDidSaveTextDocument(e => {
|
||||
pendingAsserts.push(() => assert.ok(pathEquals(e.uri.fsPath, file.fsPath)));
|
||||
pendingAsserts.push(() => assertEqualPath(e.uri.fsPath, file.fsPath));
|
||||
onDidSaveTextDocument = true;
|
||||
}));
|
||||
|
||||
@@ -291,7 +295,7 @@ suite('workspace-namespace', () => {
|
||||
|
||||
let onDidSaveTextDocument = false;
|
||||
disposables.push(vscode.workspace.onDidSaveTextDocument(e => {
|
||||
pendingAsserts.push(() => assert.ok(pathEquals(e.uri.fsPath, file.fsPath)));
|
||||
pendingAsserts.push(() => assertEqualPath(e.uri.fsPath, file.fsPath));
|
||||
onDidSaveTextDocument = true;
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user