ansble / monument

event based http server for nodejs
http://monument.ansble.com
MIT License
34 stars 45 forks source link

Fix failling test in node 10 #600

Open designfrontier opened 6 years ago

designfrontier commented 6 years ago
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.

EricBot89 commented 5 years ago

Hey, I'd love to take a look at this