Skip to content

Commit bfae15d

Browse files
Copilotmrlubos
andcommitted
Fix typecheck issues in test files
Co-authored-by: mrlubos <[email protected]>
1 parent 1d09c1d commit bfae15d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/openapi-ts/src/__tests__/error.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('shouldReportCrash', () => {
2626
.mockImplementation(() => true);
2727
const setEncodingSpy = vi
2828
.spyOn(process.stdin, 'setEncoding')
29-
.mockImplementation(() => {});
29+
.mockImplementation(() => process.stdin as any);
3030
const onceSpy = vi
3131
.spyOn(process.stdin, 'once')
3232
.mockImplementation(() => process.stdin);
@@ -53,10 +53,10 @@ describe('shouldReportCrash', () => {
5353
.mockImplementation(() => true);
5454
const setEncodingSpy = vi
5555
.spyOn(process.stdin, 'setEncoding')
56-
.mockImplementation(() => {});
56+
.mockImplementation(() => process.stdin as any);
5757
const onceSpy = vi
5858
.spyOn(process.stdin, 'once')
59-
.mockImplementation((event, callback) => {
59+
.mockImplementation((_event, callback) => {
6060
// Simulate user typing 'n'
6161
setTimeout(() => {
6262
(callback as any)('n');
@@ -86,10 +86,10 @@ describe('shouldReportCrash', () => {
8686
.mockImplementation(() => true);
8787
const setEncodingSpy = vi
8888
.spyOn(process.stdin, 'setEncoding')
89-
.mockImplementation(() => {});
89+
.mockImplementation(() => process.stdin as any);
9090
const onceSpy = vi
9191
.spyOn(process.stdin, 'once')
92-
.mockImplementation((event, callback) => {
92+
.mockImplementation((_event, callback) => {
9393
// Simulate user typing 'y'
9494
setTimeout(() => {
9595
(callback as any)('y');

packages/openapi-ts/src/__tests__/interactive.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('interactive config', () => {
1111
});
1212

1313
// In test environment, TTY is typically not available, so it should be false
14-
expect(result.results[0].config.interactive).toBe(false);
14+
expect(result.results[0]?.config.interactive).toBe(false);
1515
});
1616

1717
it('should respect user config when set to true', async () => {
@@ -21,7 +21,7 @@ describe('interactive config', () => {
2121
output: './test',
2222
});
2323

24-
expect(result.results[0].config.interactive).toBe(true);
24+
expect(result.results[0]?.config.interactive).toBe(true);
2525
});
2626

2727
it('should respect user config when set to false', async () => {
@@ -31,7 +31,7 @@ describe('interactive config', () => {
3131
output: './test',
3232
});
3333

34-
expect(result.results[0].config.interactive).toBe(false);
34+
expect(result.results[0]?.config.interactive).toBe(false);
3535
});
3636

3737
it('should allow file config to set interactive when CLI does not provide it', () => {

0 commit comments

Comments
 (0)