Skip to content

Commit 9cee0b7

Browse files
committed
Increase timeout for Windows
1 parent 049e531 commit 9cee0b7

File tree

2 files changed

+32
-16
lines changed

2 files changed

+32
-16
lines changed

packages/openapi-typescript/test/cjs.test.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22
const { fileURLToPath } = require("node:url");
33
const { astToString, default: openapiTS } = require("../dist/index.cjs");
44

5+
const TIMEOUT = 10_000;
6+
57
describe("CJS bundle", () => {
6-
it("basic", async () => {
7-
const output = `/**
8+
test(
9+
"basic",
10+
async () => {
11+
const output = `/**
812
* This file was auto-generated by openapi-typescript.
913
* Do not make direct changes to the file.
1014
*/
1115
1216
${astToString(await openapiTS(new URL("../examples/stripe-api.yaml", import.meta.url)))}`;
13-
expect(output).toMatchFileSnapshot(fileURLToPath(new URL("../examples/stripe-api.ts", import.meta.url)));
14-
});
17+
expect(output).toMatchFileSnapshot(fileURLToPath(new URL("../examples/stripe-api.ts", import.meta.url)));
18+
},
19+
{ timeout: TIMEOUT },
20+
);
1521
});

packages/openapi-typescript/test/yaml.test.ts

+22-12
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@ import { execa } from "execa";
22
import os from "node:os";
33
import { fileURLToPath } from "node:url";
44

5+
const TIMEOUT = 10_000;
6+
57
const root = new URL("../", import.meta.url);
68
const cwd = os.platform() === "win32" ? fileURLToPath(root) : root; // execa bug: fileURLToPath required on Windows
79
const cmd = "./bin/cli.js";
810

911
describe("YAML features", () => {
10-
test("merge", async () => {
11-
const result = await execa(cmd, ["./test/fixtures/yaml-merge.yaml"], {
12-
cwd,
13-
});
14-
expect(result.stdout).toBe(`/**
12+
test(
13+
"merge",
14+
async () => {
15+
const result = await execa(cmd, ["./test/fixtures/yaml-merge.yaml"], {
16+
cwd,
17+
});
18+
expect(result.stdout).toBe(`/**
1519
* This file was auto-generated by openapi-typescript.
1620
* Do not make direct changes to the file.
1721
*/
@@ -84,13 +88,17 @@ export interface operations {
8488
};
8589
};
8690
}`);
87-
});
91+
},
92+
{ timeout: TIMEOUT },
93+
);
8894

89-
test("not ignore path item components in paths", async () => {
90-
const result = await execa(cmd, ["./test/fixtures/path-item-components.yaml"], {
91-
cwd,
92-
});
93-
expect(result.stdout).toBe(`/**
95+
test(
96+
"not ignore path item components in paths",
97+
async () => {
98+
const result = await execa(cmd, ["./test/fixtures/path-item-components.yaml"], {
99+
cwd,
100+
});
101+
expect(result.stdout).toBe(`/**
94102
* This file was auto-generated by openapi-typescript.
95103
* Do not make direct changes to the file.
96104
*/
@@ -165,5 +173,7 @@ export interface operations {
165173
};
166174
};
167175
}`);
168-
});
176+
},
177+
{ timeout: TIMEOUT },
178+
);
169179
});

0 commit comments

Comments
 (0)