From 43933ce29d1d8dfbed960e4672a67824bdc157d3 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 8 Oct 2024 02:47:27 +0900 Subject: [PATCH] Make longer timeout for each browser manager on test --- test/converter.ts | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/test/converter.ts b/test/converter.ts index 7d6a85cf..9842aaf5 100644 --- a/test/converter.ts +++ b/test/converter.ts @@ -916,29 +916,34 @@ describe('Converter', () => { }) describe('with Firefox browser', () => { - it('outputs warning about incompatibility', async () => { - const warn = jest.spyOn(console, 'warn').mockImplementation() + it( + 'outputs warning about incompatibility', + async () => { + const warn = jest.spyOn(console, 'warn').mockImplementation() - await using browserManager = new BrowserManager({ - finders: ['firefox'], - }) + await using browserManager = new BrowserManager({ + finders: ['firefox'], + timeout, + }) - await pdfInstance({ - browserManager, - output: 'test.pdf', - }).convertFile(new File(onePath)) + await pdfInstance({ + browserManager, + output: 'test.pdf', + }).convertFile(new File(onePath)) - expect(warn).toHaveBeenCalledWith( - expect.stringContaining( - 'The output may include some incompatible renderings' + expect(warn).toHaveBeenCalledWith( + expect.stringContaining( + 'The output may include some incompatible renderings' + ) ) - ) - expect(fs.promises.writeFile).toHaveBeenCalled() + expect(fs.promises.writeFile).toHaveBeenCalled() - const [lastCall] = writeFileSpy.mock.calls.slice(-1) - expect(lastCall[0]).toBe('test.pdf') - expect(lastCall[1]).toBeInstanceOf(Buffer) - }) + const [lastCall] = writeFileSpy.mock.calls.slice(-1) + expect(lastCall[0]).toBe('test.pdf') + expect(lastCall[1]).toBeInstanceOf(Buffer) + }, + timeout + ) }) }) @@ -1125,6 +1130,7 @@ describe('Converter', () => { async () => { await using browserManager = new BrowserManager({ finders: ['firefox'], + timeout, }) await instance({ @@ -1225,6 +1231,7 @@ describe('Converter', () => { await using browserManager = new BrowserManager({ finders: ['chrome', 'edge'], protocol: 'webDriverBiDi', + timeout, }) await instance({ @@ -1268,6 +1275,7 @@ describe('Converter', () => { async () => { await using browserManager = new BrowserManager({ finders: ['firefox'], + timeout, }) await instance({