Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
repl-mike-roest committed Oct 23, 2023
1 parent 0bcd3b2 commit 01926c9
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ describe("superagent-retry-delay", function () {
let received = false;
agent
.get("http://localhost:" + port)
.on('error', (err) => {
.on("error", (err) => {
received = true;
})
.end(function (err, res) {
res.text.should.eql("Not Found");
res.text.should.eql("Not Found");
err.response.status.should.eql(404);
err.status.should.eql(404);
err.message.should.eql("Not Found");
Expand All @@ -49,17 +49,17 @@ describe("superagent-retry-delay", function () {

it("catches errors in the _isResponseOK and returns", function (done) {
const oldHandler = agent.Request.prototype._isResponseOK;
agent.Request.prototype._isResponseOK = (res) => { throw new Error("_isResponseOK callback error");};
agent
.get("http://localhost:" + port)
.end(function (err, res) {
res.text.should.eql("Not Found");
err.response.status.should.eql(404);
err.message.should.eql("_isResponseOK callback error");
requests.should.eql(1);
agent.Request.prototype._isResponseOK = oldHandler;
done();
});
agent.Request.prototype._isResponseOK = (res) => {
throw new Error("_isResponseOK callback error");
};
agent.get("http://localhost:" + port).end(function (err, res) {
res.text.should.eql("Not Found");
err.response.status.should.eql(404);
err.message.should.eql("_isResponseOK callback error");
requests.should.eql(1);
agent.Request.prototype._isResponseOK = oldHandler;
done();
});
});

after(function (done) {
Expand Down

0 comments on commit 01926c9

Please sign in to comment.