Fix CMS tests (#5897)

* Fix CMS tests

* Fix spacing and format
This commit is contained in:
Charles Gagnon
2019-06-05 06:07:13 +00:00
committed by GitHub
parent 685a608518
commit bb470c3676
4 changed files with 65 additions and 43 deletions

View File

@@ -75,4 +75,17 @@ export async function deleteDB(dbName: string, ownerUri: string): Promise<void>
END CATCH`;
await queryProvider.runQueryAndReturn(ownerUri, query);
}
}
export async function assertThrowsAsync(fn: () => Promise<any>, msg: string): Promise<void> {
let f = () => {
// Empty
};
try {
await fn();
} catch (e) {
f = () => { throw e; };
} finally {
assert.throws(f, msg);
}
}