@@ -2,16 +2,20 @@ import { execa } from "execa";
2
2
import os from "node:os" ;
3
3
import { fileURLToPath } from "node:url" ;
4
4
5
+ const TIMEOUT = 10_000 ;
6
+
5
7
const root = new URL ( "../" , import . meta. url ) ;
6
8
const cwd = os . platform ( ) === "win32" ? fileURLToPath ( root ) : root ; // execa bug: fileURLToPath required on Windows
7
9
const cmd = "./bin/cli.js" ;
8
10
9
11
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 ( `/**
15
19
* This file was auto-generated by openapi-typescript.
16
20
* Do not make direct changes to the file.
17
21
*/
@@ -84,13 +88,17 @@ export interface operations {
84
88
};
85
89
};
86
90
}` ) ;
87
- } ) ;
91
+ } ,
92
+ { timeout : TIMEOUT } ,
93
+ ) ;
88
94
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 ( `/**
94
102
* This file was auto-generated by openapi-typescript.
95
103
* Do not make direct changes to the file.
96
104
*/
@@ -165,5 +173,7 @@ export interface operations {
165
173
};
166
174
};
167
175
}` ) ;
168
- } ) ;
176
+ } ,
177
+ { timeout : TIMEOUT } ,
178
+ ) ;
169
179
} ) ;
0 commit comments