-
Notifications
You must be signed in to change notification settings - Fork 764
Closed
Description
Currently, using usePromise: true will result in non-200 responses being rejected. When writing failure tests w/ a generator flow control library (like co), this can result in strange looking code, for example:
var client = // ... create Swagger client w/ usePromise: true
it('should respond w/ 404', function * () {
var response;
try {
yield client.widgets.getWidget({ widgetId: 'unknown-id' });
} catch (r) {
response = r;
}
expect(response.status).to.equal(404);
});
It would be great if there was something like request-promise's simple: false option that lets us get non-200 responses like so:
it('should respond w/ 404', function * () {
var response = yield client.widgets.getWidget({ widgetId: 'unknown-id' });
expect(response.status).to.equal(404);
});
Metadata
Metadata
Assignees
Labels
No labels