Skip to content

Commit 9c55bc9

Browse files
author
pooya parsa
committed
100% coverage
1 parent f68d40b commit 9c55bc9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

test/client.test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const HTTPFSAClient = require('../lib/client')
2+
3+
it('Throws without passing endpoint', () => {
4+
expect(() => new HTTPFSAClient()).toThrow('Missing required option `endpoint`')
5+
})
6+
7+
it('Throws on unexpected status code', async () => {
8+
const client = new HTTPFSAClient({ endpoint: 'http://' })
9+
client._request = () => Promise.resolve({ status: 500 })
10+
await expect(client.exists('/')).rejects.toThrow('Error: Unexpected status 500')
11+
})
File renamed without changes.

0 commit comments

Comments
 (0)