Skip to content

Commit

Permalink
♻️ refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohland committed May 9, 2024
1 parent ae9f76d commit 8e73833
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/evaluators/web.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IApp } from "../models/app";
import { WebResult } from "../models/result";

const second = 1000;
jest.setTimeout(10 * second);
jest.setTimeout(10 * second); // httpbin and badssl aren't the fastest

describe("web evaluator", () => {
describe("isFailureWebResult", () => {
Expand Down Expand Up @@ -127,7 +127,7 @@ describe("web evaluator", () => {
const timestamp = new Date(parseInt(response.data.args.__barky));
const timeDiff = +new Date() - +timestamp;
expect(timeDiff).toBeLessThan(10000);
}, 10000); // httpbin isn't the fastest
});
describe("without http method", () => {
it("should default to get", async () => {
// arrange
Expand All @@ -140,7 +140,7 @@ describe("web evaluator", () => {

// assert
expect(response.status).toEqual(200);
}, 10000); // httpbin isn't the fastest
});
});
describe("with ssl url", () => {
describe("and default tls configuration", () => {
Expand Down Expand Up @@ -169,7 +169,7 @@ describe("web evaluator", () => {

// act && assert
await expect(() => execWebRequest(app)).rejects.toThrow(/does not match certificate's altnames/);
}, 10000);
});
});
describe("with expired certificate", () => {
it("should throw", async () => {
Expand All @@ -180,7 +180,7 @@ describe("web evaluator", () => {

// act && assert
await expect(() => execWebRequest(app)).rejects.toThrow(/certificate has expired/);
}, 10000);
});
});
describe("but with verify set to false", () => {
it("should not throw", async () => {
Expand All @@ -197,7 +197,7 @@ describe("web evaluator", () => {

// assert
expect(result.status).toEqual(200);
}, 10000);
});
});
});
});
Expand Down

0 comments on commit 8e73833

Please sign in to comment.