Skip to content
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

Issue #34 Add isValid assertion #87

Merged
merged 1 commit into from
Apr 14, 2021

Conversation

ystarangl
Copy link
Contributor

Resolves #34

Added new isValid assertion. Updated docs.

The only thing to note here is that there is no expected value because we're expecting anything except invalid. So I'm passing non-invalid string there.

Sample test case:

m.it("in the test case", sub()
    m.assert.isInvalid({}, "should be invalid")
    m.assert.isValid(invalid, "should be valid")
end sub)

When isInvalid not commented out:
image

When isValid not commented out:
image

@lkipke lkipke requested review from sjbarag, lkipke and alimnios72 April 14, 2021 13:14
@lkipke lkipke assigned lkipke and unassigned lkipke Apr 14, 2021
@lkipke lkipke added documentation enhancement New feature or request labels Apr 14, 2021
Copy link
Contributor

@lkipke lkipke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thanks for updating the docs as well!

m.__fail(m.formatError({
message: error,
actual: actual,
expected: "non-invalid",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a little strange, but this seems like the best way to represent the expected value 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... I've been thinking A LOT about what should I pass there. Definitely more than I had to. 😄 But I'm actually satisfied with this one.

Copy link
Contributor

@alimnios72 alimnios72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks

@alimnios72 alimnios72 merged commit 04ebfd7 into hulu:main Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add isValid assertion
3 participants