-
Notifications
You must be signed in to change notification settings - Fork 781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve assert.throws() error in TAP reporter #1333
Labels
Milestone
Comments
Krinkle
added a commit
that referenced
this issue
Dec 15, 2018
trentmwillis
pushed a commit
that referenced
this issue
Dec 17, 2018
Krinkle
added a commit
that referenced
this issue
Jan 3, 2019
Follows-up #1335, which was missing the quotes on the tap-outputs key, and thus the unit test was seeing expectedOutput[command] as `undefined`, which was then passed to RegExp as `new RegExp(undefined)`, which produces /(?:)/, which is a no-op that always matches, so re.test(output) === true. Yay me for writing a useless test. Ref #1333.
Krinkle
added a commit
that referenced
this issue
Jan 3, 2019
Report the `actual` (Error object) as a string. And report an `expected` RegExp or Error object also in its string form. Currently, they were reported as their objects, which in the generic js-reporters module was just printed as an empty object without any properties because instances of RegExp and instances of Error both have no own properties that are enumerable. Fixes #1333.
Krinkle
added a commit
that referenced
this issue
Jan 3, 2019
Report the `actual` (Error object) as a string. And report an `expected` RegExp or Error object also in its string form. Currently, they were reported as their objects, which in the generic js-reporters module was just printed as an empty object without any properties because instances of RegExp and instances of Error both have no own properties that are enumerable. Fixes #1333.
Krinkle
added a commit
that referenced
this issue
Jan 3, 2019
Report the `actual` (Error object) as a string. And report an `expected` RegExp or Error object also in its string form. Currently, they were reported as their objects, which in the generic js-reporters module was just printed as an empty object without any properties because instances of RegExp and instances of Error both have no own properties that are enumerable. Also fix errorString() which oddly had logic for passing a plain object, but didn't Fixes #1333.
Krinkle
added a commit
that referenced
this issue
Jan 3, 2019
Follows-up #1335, which was missing the quotes on the tap-outputs key, and thus the unit test was seeing expectedOutput[command] as `undefined`, which was then passed to RegExp as `new RegExp(undefined)`, which produces /(?:)/, which is a no-op that always matches, so re.test(output) === true. Yay me for writing a useless test. Ref #1333.
Krinkle
added a commit
that referenced
this issue
Jan 3, 2019
Report the `actual` (Error object) as a string. And report an `expected` RegExp or Error object also in its string form. Currently, they were reported as their objects, which in the generic js-reporters module was just printed as an empty object without any properties because instances of RegExp and instances of Error both have no own properties that are enumerable. Also fix errorString() which oddly had logic for passing a plain object, but didn't Fixes #1333.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Test case
What actually happened?
The text was updated successfully, but these errors were encountered: