You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
522 B
19 lines
522 B
import test from 'ava';
|
|
import nock from 'nock';
|
|
import Onionoo from '../';
|
|
import data from './fixtures/data';
|
|
|
|
test('Can pass in custom endpoint', async t => {
|
|
const baseUrl = 'http://foo.com';
|
|
const defaultEndpoint = data.defaultEndpoints[0];
|
|
const onionoo = new Onionoo({baseUrl});
|
|
|
|
const scope = nock(baseUrl)
|
|
.get(`/${defaultEndpoint}`)
|
|
.reply(200, data.dummyResponse);
|
|
|
|
const response = await onionoo[defaultEndpoint]();
|
|
|
|
t.deepEqual(response.body, data.dummyResponse);
|
|
t.truthy(scope.isDone());
|
|
});
|
|
|