mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Implement the auth test differently to not use assert.rejects
This commit is contained in:
parent
76205395d5
commit
e4fa4063da
|
@ -153,10 +153,15 @@ suite('MainThreadAuthentication', () => {
|
|||
});
|
||||
|
||||
test('Can not recreate a session if none exists', async () => {
|
||||
await assert.rejects(() => mainThreadAuthentication.$getSession('empty', ['foo'], 'testextension', 'test extension', {
|
||||
createIfNone: false,
|
||||
clearSessionPreference: false,
|
||||
forceRecreate: true
|
||||
}), new Error('No existing sessions found.'));
|
||||
try {
|
||||
await mainThreadAuthentication.$getSession('empty', ['foo'], 'testextension', 'test extension', {
|
||||
createIfNone: false,
|
||||
clearSessionPreference: false,
|
||||
forceRecreate: true
|
||||
});
|
||||
assert.fail('should have thrown an Error.');
|
||||
} catch (e) {
|
||||
assert.strictEqual(e.message, 'No existing sessions found.');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue