mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-22 08:17:30 +02:00
Similar to e7ad3845f, avoid using finally(done) as it swallows errors
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user