+
Skip to content

Fix failling test in node 10 #600

Open
@designfrontier

Description

@designfrontier
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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载