Skip to content

Commit

Permalink
Update timeout for converter testing
Browse files Browse the repository at this point in the history
  • Loading branch information
yhatt committed Dec 25, 2024
1 parent dfad3ed commit baa86e2
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions test/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { ThemeSet } from '../src/theme'
import { WatchNotifier } from '../src/watcher'

const timeout = 60000
const timeoutLarge = 120000

let mkdirSpy: jest.SpiedFunction<typeof fs.promises.mkdir>
let writeFileSpy: jest.SpiedFunction<typeof fs.promises.writeFile>
Expand Down Expand Up @@ -903,16 +904,20 @@ describe('Converter', () => {
})

describe('with custom timeout set by browser manager', () => {
it('follows setting timeout', async () => {
await using browserManager = new BrowserManager({ timeout: 1 })
it(
'follows setting timeout',
async () => {
await using browserManager = new BrowserManager({ timeout: 1 })

await expect(
pdfInstance({
browserManager,
output: 'test.pdf',
}).convertFile(new File(onePath))
).rejects.toThrow(TimeoutError)
})
await expect(
pdfInstance({
browserManager,
output: 'test.pdf',
}).convertFile(new File(onePath))
).rejects.toThrow(TimeoutError)
},
timeout
)
})

describe('with Firefox browser', () => {
Expand Down Expand Up @@ -1220,7 +1225,7 @@ describe('Converter', () => {
expect(width).toBe(640)
expect(height).toBe(360)
},
timeout * 1.5
timeoutLarge
)
})

Expand Down

0 comments on commit baa86e2

Please sign in to comment.