diff --git a/.changeset/poor-bulldogs-repeat.md b/.changeset/poor-bulldogs-repeat.md new file mode 100644 index 0000000000..ee97632ae6 --- /dev/null +++ b/.changeset/poor-bulldogs-repeat.md @@ -0,0 +1,5 @@ +--- +"@medusajs/medusa-oas-cli": patch +--- + +fix(oas:test): fix beforeAll timeout silent failure diff --git a/packages/oas/medusa-oas-cli/jest.config.js b/packages/oas/medusa-oas-cli/jest.config.js index 5e9ddf76a1..8cdcf8d10f 100644 --- a/packages/oas/medusa-oas-cli/jest.config.js +++ b/packages/oas/medusa-oas-cli/jest.config.js @@ -10,5 +10,5 @@ module.exports = { }, testEnvironment: `node`, moduleFileExtensions: [`js`, `ts`], - testTimeout: 30000, + testTimeout: 60000, } diff --git a/packages/oas/medusa-oas-cli/src/__tests__/command-oas.test.ts b/packages/oas/medusa-oas-cli/src/__tests__/command-oas.test.ts index 434f79cfba..91e84dd133 100644 --- a/packages/oas/medusa-oas-cli/src/__tests__/command-oas.test.ts +++ b/packages/oas/medusa-oas-cli/src/__tests__/command-oas.test.ts @@ -82,6 +82,11 @@ describe("command oas", () => { describe("--type admin", () => { let oas: OpenAPIObject + /** + * In a CI context, beforeAll might exceed the configured jest timeout. + * Until we upgrade our jest version, the timeout error will be swallowed + * and the test will fail in unexpected ways. + */ beforeAll(async () => { const outDir = path.resolve(tmpDir, uid()) await runCLI("oas", ["--type", "admin", "--out-dir", outDir]) diff --git a/packages/oas/medusa-oas-cli/tsconfig.spec.json b/packages/oas/medusa-oas-cli/tsconfig.spec.json new file mode 100644 index 0000000000..9b62409191 --- /dev/null +++ b/packages/oas/medusa-oas-cli/tsconfig.spec.json @@ -0,0 +1,5 @@ +{ + "extends": "./tsconfig.json", + "include": ["src"], + "exclude": ["node_modules"] +}