Skip to content

Commit

Permalink
Merge branch 'main' into remove-nodemon
Browse files Browse the repository at this point in the history
  • Loading branch information
pmcelhaney authored Jan 1, 2025
2 parents ee895bd + fcfb2ea commit d955c9e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"eslint-plugin-unused-imports": "4.1.4",
"husky": "9.1.7",
"jest": "29.7.0",
"jest-retries": "^1.0.1",
"node-mocks-http": "1.16.2",
"rimraf": "6.0.1",
"stryker-cli": "1.0.2",
Expand Down
12 changes: 6 additions & 6 deletions test/server/response-builder.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createResponseBuilder } from "../../src/server/response-builder.js";
import type { OpenApiOperation } from "../../src/server/types.ts";
import retry from "jest-retries";

describe("a response builder", () => {
it("starts building a response object when the status is selected", () => {
Expand Down Expand Up @@ -135,11 +136,10 @@ describe("a response builder", () => {
type: "text/plain",
});

// This assertion is flaky. The root cause seems to be JSON Schema Faker
// expect(response?.content?.[0]).toStrictEqual({
// body: { value: "hello" },
// type: "application/json",
// });
expect(response?.content?.[0]).toStrictEqual({
body: { value: "hello" },
type: "application/json",
});
});

it("falls back to 'default' when status code is not listed explicitly", () => {
Expand Down Expand Up @@ -227,7 +227,7 @@ describe("a response builder", () => {
},
};

it("using the status code", () => {
retry("using the status code", 10, () => {
const response = createResponseBuilder(operation)[200]?.random();

expect(response?.status).toBe(200);
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7615,6 +7615,11 @@ jest-resolve@^29.7.0:
resolve.exports "^2.0.0"
slash "^3.0.0"

jest-retries@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/jest-retries/-/jest-retries-1.0.1.tgz#b60eac2c6f6ee7033fbc9a3cb6f3016a63b82822"
integrity sha512-tR9tCXs9+Vqw/2toQEOg+CpzOwUqReppcZH2550EnuEhw4F8TR+NbICPUJexegjN9xnuF4ABSGPgzCgAFZI0Ng==

jest-runner@^29.7.0:
version "29.7.0"
resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.7.0.tgz#809af072d408a53dcfd2e849a4c976d3132f718e"
Expand Down

0 comments on commit d955c9e

Please sign in to comment.