From 4689b0882a0b0827f10d2a485bc5e3a61b417b1e Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 22 Dec 2016 12:49:35 +0700 Subject: [PATCH] Split endpoint tests out into seperate file --- test/endpoints.js | 26 ++++++++++++++++++++++++++ test/unit.js | 24 ------------------------ 2 files changed, 26 insertions(+), 24 deletions(-) create mode 100644 test/endpoints.js diff --git a/test/endpoints.js b/test/endpoints.js new file mode 100644 index 0000000..29caa7a --- /dev/null +++ b/test/endpoints.js @@ -0,0 +1,26 @@ +import test from 'ava' +import Onionoo from '../' + +test('Onionoo instance contains expected endpoints', t => { + const onionoo = new Onionoo() + const expectedEndpoints = [ + 'summary', + 'details', + 'bandwidth', + 'weights', + 'clients', + 'uptime' + ] + + t.deepEqual(Object.keys(onionoo), expectedEndpoints) +}) + +test('Can pass in custom endpoint array', t => { + const endpoints = [ + 'foo', + 'bar' + ] + const onionoo = new Onionoo({ endpoints }) + + t.deepEqual(Object.keys(onionoo), endpoints) +}) diff --git a/test/unit.js b/test/unit.js index a9af3d1..1ea807d 100644 --- a/test/unit.js +++ b/test/unit.js @@ -15,27 +15,3 @@ test('Onionoo instance is an object', t => { t.is(typeof onionoo, 'object') }) - -test('Onionoo instance contains expected endpoints', t => { - const onionoo = new Onionoo() - const expectedEndpoints = [ - 'summary', - 'details', - 'bandwidth', - 'weights', - 'clients', - 'uptime' - ] - - t.deepEqual(Object.keys(onionoo), expectedEndpoints) -}) - -test('Can pass in custom endpoint array', t => { - const endpoints = [ - 'foo', - 'bar' - ] - const onionoo = new Onionoo({ endpoints }) - - t.deepEqual(Object.keys(onionoo), endpoints) -})