mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
test(route) add
This commit is contained in:
parent
27cbed207b
commit
8b4bc7cdc9
1 changed files with 24 additions and 0 deletions
24
test/server/route.js
Normal file
24
test/server/route.js
Normal file
|
|
@ -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();
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue