-
Notifications
You must be signed in to change notification settings - Fork 14
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
BigTest add way to assert thrown exception #1036
Comments
Could we say test
.step(renderCalendar({ maxDate: new Date("2014-08-18") }))
.assertion(Fails(calendar.setDay(20))) |
@cowboyd What about? test
.step(renderCalendar({ maxDate: new Date("2014-08-18") }))
.exception(calendar.setDay(20))
// Or
.exception('With error message', calendar.setDay(20)) The reason is Another approach is don't fail on any test
.step(renderCalendar({ maxDate: new Date("2014-08-18") }))
.step(calendar.setDay(20))
.assertion(Fails('With error message')) |
Hmmm... I think option two is more doable today: test
.step(renderCalendar({ maxDate: new Date("2014-08-18") }))
.step("try to set calendar day", async () => {
try {
await calendar.setDay(20);
return { error: null };
} catch (error) {
return { error };
}
})
.assertion(({ error }) => assert(error != null error.mesage == 'with error message')) |
I transferred this to bigtest, since it is more relevant to bigtest than interactors. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For now there is no way to test a specific thrown Error message. As example if we have this test where calendar day restriction is limited and we try to select disabled day.
The calendar should throw
new Error(
Can't select ${day} day because it's disabled);
The text was updated successfully, but these errors were encountered: