mirror of
https://github.com/bigchaindb/js-bigchaindb-driver.git
synced 2024-11-22 09:46:58 +01:00
Add test for baseRequest.js
This commit adds tests for baseRequest, with the aim to improve the code coverage of the whole repo. Part of https://github.com/bigchaindb/js-bigchaindb-driver/issues/220
This commit is contained in:
parent
48f7584374
commit
074b4f0871
15
test/base-request/test_baseRequest.js
Normal file
15
test/base-request/test_baseRequest.js
Normal file
@ -0,0 +1,15 @@
|
||||
import test from 'ava'
|
||||
import baseRequest from '../../src/baseRequest'
|
||||
|
||||
test('baseRequest test query and vsprint', async t => {
|
||||
const target = {
|
||||
message: 'HTTP Error: Requested page not reachable',
|
||||
requestURI: 'https://www.google.com/teapot',
|
||||
status: '418 I\'m a Teapot',
|
||||
}
|
||||
const error = await t.throws(baseRequest('https://%s.com/', {
|
||||
urlTemplateSpec: ['google'],
|
||||
query: 'teapot'
|
||||
}))
|
||||
t.deepEqual(target, error)
|
||||
})
|
Loading…
Reference in New Issue
Block a user