more verbose integration test failures
This commit is contained in:
parent
c379e3226e
commit
6158372c89
1 changed files with 8 additions and 4 deletions
|
@ -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;
|
||||
}));
|
||||
|
||||
|
|
Loading…
Reference in a new issue