You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am on Node 6.2.1 and use ES2015 syntax (whatever is supported). I'm writing a CLI tool and I have two occasions where I reject a promise with a custom error (with different messages):
reject(new NoMatchingFilesError('No matching tweet files in directory.'));
In node-debug I see no difference: In both cases the Constructor looks fine and the prototype chains looks fine, and yet one test fails. When I rewrite my code use Error instead of custom NoMatchingFilesError both tests pass.
I am on Node 6.2.1 and use ES2015 syntax (whatever is supported). I'm writing a CLI tool and I have two occasions where I reject a promise with a custom error (with different messages):
with
NoMatchingFilesError
being defined asThere are 2 corresponding unit tests that look like this (different messages):
When I run the tests the first test fails and the second test passes.
I tracked the issue down to this line: https://github.com/domenic/chai-as-promised/blob/master/lib/chai-as-promised.js#L192. The test fails because
reason instanceof Constructor
evaluates tofalse
for the first test. The second one evaluates totrue
.In
node-debug
I see no difference: In both cases theConstructor
looks fine and the prototype chains looks fine, and yet one test fails. When I rewrite my code useError
instead of customNoMatchingFilesError
both tests pass.Any idea what's going wrong here?
This might be related to #113.
The text was updated successfully, but these errors were encountered: