Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Dec 10, 2023
1 parent d75d536 commit d65119c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion test/e2e/generate-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,13 @@ describe('Type-generation', () => {
tmpfile: outFileComplex,
} satisfies ts.server.protocol.SavetoRequestArgs);

server.sendCommand('saveto', {
file: outFileComplex,
tmpfile: outFileComplex,
} satisfies ts.server.protocol.SavetoRequestArgs);

await waitForExpect(() => {
const contents = fs.readFileSync(outFileComplex, 'utf-8');
console.log('gen complex', [...server.responses], contents);
expect(contents).toContain(` id
}
\` as typeof import('./rename-complex.generated').PostFieldsFragmentDoc`);
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type WaitForExpectOptions = {

export const waitForExpect = async (
expectFn: () => void,
{ interval = 500, timeout = 20000 }: WaitForExpectOptions = {}
{ interval = 2000, timeout = 30000 }: WaitForExpectOptions = {}
) => {
// @sinonjs/fake-timers injects `clock` property into setTimeout
const usesFakeTimers = 'clock' in setTimeout;
Expand Down

0 comments on commit d65119c

Please sign in to comment.