Skip to content

Commit

Permalink
test: add another test for downloadURL function
Browse files Browse the repository at this point in the history
  • Loading branch information
MilosPaunovic committed Jun 29, 2024
1 parent 03a8691 commit c21ae53
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/unit/modules/various/downloadURL.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ import { describe, expect, it } from 'vitest'
import { downloadURL } from 'src/index'

const INVALID = 'invalid'
const VALID = 'https://example.com/report.pdf'
const NAME = 'report.pdf'

describe('downloadURL', () => {
it('throws error on invalid URL', () => {
expect(() => downloadURL(INVALID)).toThrow('Invalid URL provided')
expect(() => downloadURL(INVALID, NAME)).toThrow('Invalid URL provided.')
})

it('throws error on missing filename', () => {
expect(() => downloadURL(VALID)).toThrow('Filename is required.')

Check failure on line 14 in test/unit/modules/various/downloadURL.test.ts

View workflow job for this annotation

GitHub Actions / typecheck

Expected 2 arguments, but got 1.
})
})

0 comments on commit c21ae53

Please sign in to comment.