mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 09:08:53 +01:00
Always reject Promises with Error instances
This commit is contained in:
@@ -23,12 +23,12 @@ suite('Cache', () => {
|
||||
|
||||
test('simple error', () => {
|
||||
let counter = 0;
|
||||
const cache = new Cache(() => TPromise.wrapError(counter++));
|
||||
const cache = new Cache(() => TPromise.wrapError(new Error(String(counter++))));
|
||||
|
||||
return cache.get()
|
||||
.then(() => assert.fail(), err => assert.equal(err, 0))
|
||||
.then(() => assert.fail(), err => assert.equal(err.message, 0))
|
||||
.then(() => cache.get())
|
||||
.then(() => assert.fail(), err => assert.equal(err, 0));
|
||||
.then(() => assert.fail(), err => assert.equal(err.message, 0));
|
||||
});
|
||||
|
||||
test('should retry cancellations', () => {
|
||||
|
||||
Reference in New Issue
Block a user