From 7bd4224a053a92288ec676f583de161af21c927f Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Wed, 11 Dec 2019 12:19:02 +0100 Subject: [PATCH] add tests for subdir --- test/main.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/test/main.js b/test/main.js index ef8e861..7482803 100644 --- a/test/main.js +++ b/test/main.js @@ -28,7 +28,7 @@ describe('requestor', () => { }); it('should detect all requests on root', () => { - requestor(mock, './test/root', {}); + requestor(mock, './test/root'); expect(mock.registered).to.have.all.keys([ 'post-/', 'get-/', @@ -39,7 +39,7 @@ describe('requestor', () => { }); it('should detect requests on root.subfolder', () => { - requestor(mock, './test/root.sub', {}); + requestor(mock, './test/root.sub'); expect(mock.registered).to.have.all.keys([ 'post-/sub/', 'get-/sub/', @@ -50,7 +50,7 @@ describe('requestor', () => { }); it('should detect requests on subfolder', () => { - requestor(mock, './test/sub', {}); + requestor(mock, './test/sub'); expect(mock.registered).to.have.all.keys([ 'post-/sub/', 'get-/sub/', @@ -61,4 +61,17 @@ describe('requestor', () => { 'all-/sub/root/' ]); }); + + it('should build requests with subdirectory', () => { + requestor(mock, './test/sub', {}, 'test'); + expect(mock.registered).to.have.all.keys([ + 'post-/test/sub/', + 'get-/test/sub/', + 'put-/test/sub/', + 'delete-/test/sub/', + 'all-/test/sub/', + 'get-/test/sub/lv1/lv2/lv3/', + 'all-/test/sub/root/' + ]); + }); });