Skip to content

Commit 1c810d3

Browse files
committed
Fix unit tests in cli.test.ts
1 parent 5167996 commit 1c810d3

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

packages/rtk-query-codegen-openapi/test/cli.test.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,13 @@ describe('CLI options testing', () => {
3232
if (!(await isDir(tmpDir))) {
3333
await fs.mkdir(tmpDir, { recursive: true });
3434
}
35-
return removeTempDir;
3635
});
3736

3837
afterEach(async () => {
3938
await rimraf(`${tmpDir}/*.ts`, { glob: true });
4039
});
4140

42-
test('generation with `config.example.js`', async () => {
41+
test('generation with `config.example.js`', { timeout: 25_000 }, async () => {
4342
const out = await cli(['./test/config.example.js']);
4443

4544
expect(out).toEqual({
@@ -50,9 +49,9 @@ Done
5049
});
5150

5251
expect(await fs.readFile(path.resolve(tmpDir, 'example.ts'), 'utf-8')).toMatchSnapshot();
53-
}, 25_000);
52+
});
5453

55-
test('paths are relative to config file, not to cwd', async () => {
54+
test('paths are relative to config file, not to cwd', { timeout: 25_000 }, async () => {
5655
const out = await cli([`./test/config.example.js`]);
5756

5857
expect(out).toEqual({
@@ -63,9 +62,9 @@ Done
6362
});
6463

6564
expect(await fs.readFile(path.resolve(tmpDir, 'example.ts'), 'utf-8')).toMatchSnapshot();
66-
}, 25_000);
65+
});
6766

68-
test('ts, js and json all work the same', async () => {
67+
test('ts, js and json all work the same', { timeout: 120_000 }, async () => {
6968
await cli([`./test/config.example.js`]);
7069
const fromJs = await fs.readFile(path.resolve(tmpDir, 'example.ts'), 'utf-8');
7170
await cli([`./test/config.example.ts`]);
@@ -75,11 +74,11 @@ Done
7574

7675
expect(fromTs).toEqual(fromJs);
7776
expect(fromJson).toEqual(fromJs);
78-
}, 120_000);
77+
});
7978

80-
test("missing parameters doesn't fail", async () => {
79+
test("missing parameters doesn't fail", { timeout: 25_000 }, async () => {
8180
await expect(() => cli([`./test/config.invalid-example.json`])).rejects.toThrowError(
8281
"Error: path parameter petId does not seem to be defined in '/pet/{petId}'!"
8382
);
84-
}, 25_000);
83+
});
8584
});

0 commit comments

Comments
 (0)