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/' + ]); + }); });