mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 01:25:36 -05:00
Properly expose errors in ads and tests (#8692)
* add code to expose errors outside zone * remove unexpect error hiding * remove uncessary code * fix tests * trying to catch more errros * revert for testing * wip * wip * figured out what was going on * wip * fix tests * fix tests
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
|
||||
export async function assertThrowsAsync(fn: () => Promise<any>, expectedMessage?: string): Promise<void> {
|
||||
let threw = false;
|
||||
try {
|
||||
await fn();
|
||||
} catch (e) {
|
||||
threw = true;
|
||||
if (expectedMessage) {
|
||||
assert.strictEqual(e.message, expectedMessage);
|
||||
}
|
||||
}
|
||||
assert.equal(threw, true, 'Expected function to throw but it did not');
|
||||
}
|
||||
Reference in New Issue
Block a user