From 8b4bc7cdc9fdd7e8bdfc61fb3550dbc45ae29ab1 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 28 Mar 2017 16:04:44 +0300 Subject: [PATCH] test(route) add --- test/server/route.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/server/route.js diff --git a/test/server/route.js b/test/server/route.js new file mode 100644 index 00000000..bcc845ff --- /dev/null +++ b/test/server/route.js @@ -0,0 +1,24 @@ +'use strict'; + +const test = require('tape'); +const route = require('../../server/route'); + +test('cloudcmd: route: no args', (t) => { + t.throws(route, /req could not be empty!/, 'should throw when no args'); + t.end(); +}); + +test('cloudcmd: route: no res', (t) => { + const fn = () => route({}); + + t.throws(fn, /res could not be empty!/, 'should throw when no res'); + t.end(); +}); + +test('cloudcmd: route: no next', (t) => { + const fn = () => route({}, {}); + + t.throws(fn, /next should be function!/, 'should throw when no next'); + t.end(); +}); +