This repository was archived by the owner on Jul 12, 2025. It is now read-only.
Added test for strange exception swallowing origamitower/folktale#163#164
Open
jmatsushita wants to merge 3 commits intoorigamitower:masterfrom
Open
Added test for strange exception swallowing origamitower/folktale#163#164jmatsushita wants to merge 3 commits intoorigamitower:masterfrom
jmatsushita wants to merge 3 commits intoorigamitower:masterfrom
Conversation
robotlolita
reviewed
Nov 16, 2017
| // Should have thrown by then | ||
| $ASSERT(false) | ||
| } catch (e) { | ||
| if (e.message != 'false') $ASSERT(e instanceof TypeError) |
Member
There was a problem hiding this comment.
This should be testing if the error is an instance of AssertionError, so:
const { AssertionError } = require('assert');
if (!(e instanceof AssertionError)) {
$ASSERT(e instanceof TypeError);
}
Author
There was a problem hiding this comment.
Hi! I tried to use assert.throws() which would have been clearer, but it wouldn't compile. I simplified the test though now. Hopefully it is clearer.
robotlolita
reviewed
Dec 17, 2017
| .map((() => false ? Result.a : Result.b)) | ||
| .run() | ||
| .promise(); | ||
| // Should have thrown a TypeError by then |
Member
There was a problem hiding this comment.
Why is this one expected to throw a TypeError here?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first test correctly throws a
TypeError. But the second test doesn't, it in fact throws anAssertionErrormeaning theTypeErrorexception has been swallowed.