Skip to content

Commit

Permalink
Make longer timeout for each browser manager on test
Browse files Browse the repository at this point in the history
  • Loading branch information
yhatt committed Oct 7, 2024
1 parent d4cc2fc commit 43933ce
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions test/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
})
})

Expand Down Expand Up @@ -1125,6 +1130,7 @@ describe('Converter', () => {
async () => {
await using browserManager = new BrowserManager({
finders: ['firefox'],
timeout,
})

await instance({
Expand Down Expand Up @@ -1225,6 +1231,7 @@ describe('Converter', () => {
await using browserManager = new BrowserManager({
finders: ['chrome', 'edge'],
protocol: 'webDriverBiDi',
timeout,
})

await instance({
Expand Down Expand Up @@ -1268,6 +1275,7 @@ describe('Converter', () => {
async () => {
await using browserManager = new BrowserManager({
finders: ['firefox'],
timeout,
})

await instance({
Expand Down

0 comments on commit 43933ce

Please sign in to comment.