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

Added an api to fail tests with an exception #263

Merged
merged 2 commits into from
Jan 24, 2024

Conversation

chrisdp
Copy link
Collaborator

@chrisdp chrisdp commented Jan 22, 2024

example:

@async
@it("loginUser success path")
function _()
	m.node.top.isLoggedIn = false
	' Success Test
	promises.chain(loginUser({
		email: "[email protected]"
		password: "1234"
	})).catch(sub(error as dynamic)
		' Report that the test failed due to a crash
		m.testSuite.failCrash(error)
	end sub).finally(sub()
		m.testSuite.assertTrue(m.top.isLoggedIn)
		m.testSuite.done()
	end sub)
end function

Useful in cases where your code returns an exception to you that you want to report as a crash.

@chrisdp chrisdp added the enhancement New feature or request label Jan 22, 2024
@chrisdp chrisdp linked an issue Jan 22, 2024 that may be closed by this pull request
@georgejecook georgejecook merged commit 71ebf84 into master Jan 24, 2024
10 checks passed
@georgejecook georgejecook deleted the feature/report-crash-api branch January 24, 2024 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the ability to self report a crash
2 participants