From d65119c6a3b1772832ce9a16752216de52a795c1 Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Sun, 10 Dec 2023 14:58:10 +0100 Subject: [PATCH] tests --- test/e2e/generate-types.test.ts | 6 +++++- test/e2e/util.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/e2e/generate-types.test.ts b/test/e2e/generate-types.test.ts index e0ee905a..1164dabf 100644 --- a/test/e2e/generate-types.test.ts +++ b/test/e2e/generate-types.test.ts @@ -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`); diff --git a/test/e2e/util.ts b/test/e2e/util.ts index a8a47976..7f9724b2 100644 --- a/test/e2e/util.ts +++ b/test/e2e/util.ts @@ -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;