1
0
mirror of https://github.com/bigchaindb/js-bigchaindb-driver.git synced 2024-06-30 13:41:59 +02:00
js-bigchaindb-driver/test/base-request/test_baseRequest.js
Arjun Nemani 074b4f0871 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
2018-07-19 21:20:08 +05:30

16 lines
475 B
JavaScript

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)
})