Similar to e7ad3845f, avoid using finally(done) as it swallows errors

This commit is contained in:
Bryan Housel
2021-08-16 15:34:26 -04:00
parent e7ad3845f9
commit 4f1d5f0851
2 changed files with 19 additions and 8 deletions
+15 -6
View File
@@ -43,12 +43,12 @@ describe('iD.coreLocations', function() {
var prom = locationManager.mergeLocationSets({});
prom
.then(function() {
throw new Error('This was supposed to fail, but somehow succeeded.');
done(new Error('This was supposed to fail, but somehow succeeded.'));
})
.catch(function(err) {
expect(/^nothing to do/.test(err)).to.be.true;
})
.finally(done);
done();
});
window.setTimeout(function() {}, 20); // async - to let the promise settle in phantomjs
});
@@ -64,8 +64,11 @@ describe('iD.coreLocations', function() {
expect(data).to.be.a('array');
expect(data[0].locationSetID).to.eql('+[Q2]');
expect(data[1].locationSetID).to.eql('+[Q30]');
done();
})
.finally(done);
.catch(function(err) {
done(err);
});
window.setTimeout(function() {}, 20); // async - to let the promise settle in phantomjs
});
@@ -81,8 +84,11 @@ describe('iD.coreLocations', function() {
expect(data).to.be.a('array');
expect(data[0].locationSetID).to.eql('+[Q2]');
expect(data[1].locationSetID).to.eql('+[Q2]');
done();
})
.finally(done);
.catch(function(err) {
done(err);
});
window.setTimeout(function() {}, 20); // async - to let the promise settle in phantomjs
});
@@ -139,8 +145,11 @@ describe('iD.coreLocations', function() {
expect(result2).to.be.an('object').that.has.all.keys('+[Q2]', '+[Q30]');
var result3 = locationManager.locationsAt([13.575, 41.207,]); // Gaeta
expect(result3).to.be.an('object').that.has.all.keys('+[Q2]');
done();
})
.finally(done);
.catch(function(err) {
done(err);
});
window.setTimeout(function() {}, 20); // async - to let the promise settle in phantomjs
});
+4 -2
View File
@@ -40,9 +40,11 @@ describe('iD.coreValidator', function () {
expect(issue.type).to.eql('missing_tag');
expect(issue.entityIds).to.have.lengthOf(1);
expect(issue.entityIds[0]).to.eql('w-1');
done();
})
.finally(done);
.catch(function(err) {
done(err);
});
window.setTimeout(function() {}, 20); // async - to let the promise settle in phantomjs
});