test('should throw if an invalid value for routePath is passed', (t) => {
const invalidPathString = '(TypeError \[ERR_INVALID_ARG_TYPE\]: The "path" argument must be one of type string, Buffer, or URL. Received type undefined)' +
'| (TypeError: path must be a string or Buffer)';
t.throws(setup, new RegExp(invalidPathString), TypeError);
t.throws(() => {
setup('somewhere', 'else');
}, 'Error: ENOENT: no such file or directory, scandir \'somewhere\'');
t.throws(() => {
setup('./test_stubs/routes_stub.json', 'else');
}, 'Error: ENOTDIR: not a directory, scandir \'./test_stubs/routes_stub.json\'');
});
isn't quite right... and is still failing under node 10. It looks like maybe the error comes back as an object now but needs a little digging.
isn't quite right... and is still failing under node 10. It looks like maybe the error comes back as an object now but needs a little digging.