fix documentation

This commit is contained in:
Timo Hocker 2019-12-11 13:07:48 +01:00
parent 1534917132
commit 6baeade4c0
2 changed files with 9 additions and 2 deletions

View File

@ -1,12 +1,19 @@
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
/**
* @typedef {Object} options
* @property {any} [opts] object to pass to the handlers
* @property {string} [subdir] subdirectory for all requests
* @property {boolean} [verbose] enable verbose logging
*/
/** /**
* Load all request handlers in the given folder * Load all request handlers in the given folder
* *
* @param {any} app express app * @param {any} app express app
* @param {string} modulefolder folder that contains all modules * @param {string} modulefolder folder that contains all modules
* @param {{opts: any, subdir: string, verbose: boolean}} options * @param {options} options
*/ */
module.exports = function ( module.exports = function (
app, app,

View File

@ -63,7 +63,7 @@ describe('requestor', () => {
}); });
it('should build requests with subdirectory', () => { it('should build requests with subdirectory', () => {
requestor(mock, './test/sub', {}, 'test'); requestor(mock, './test/sub', { subdir: 'test' });
expect(mock.registered).to.have.all.keys([ expect(mock.registered).to.have.all.keys([
'post-/test/sub/', 'post-/test/sub/',
'get-/test/sub/', 'get-/test/sub/',