add tests for subdir
This commit is contained in:
parent
d680bf4c5e
commit
7bd4224a05
19
test/main.js
19
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/'
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user