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 stop and dump features to TestCase #599

Merged
merged 2 commits into from
Apr 23, 2022

Conversation

girardinsamuel
Copy link
Contributor

This PR adds:

  1. adds dump() method to a TestCase:
    By default when printing something in a unit test, it's not printed in the console excepted if the test fails. To allow printing data, a dump() method has been added to TestCase (a title can be optionally provided):
self.dump({"test": "key"}, "dump test")

image

  1. adds stop() method to a TestCase: to make a test stop. A message can be provided
self.stop("I wanted it !")

.3 adds helpers to HTTP test responses:

self.get("/").dumpSession().dumpResponseHeaders().assertOk()
  • dumpSession: dump session data during a test
  • dumpRequestHeaders: dump request headers during a test
  • dumpResponseHeaders: dump response headers during a test
  • ddSession: dump session data in console during a test and die (test stops)
  • ddHeaders: dump request and response headers in console during a test and die (test stops)

@girardinsamuel girardinsamuel added the Next Minor Non-breaking change that can go into the next minor version label Apr 22, 2022
@josephmancuso josephmancuso merged commit 57a7900 into MasoniteFramework:4.0 Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Next Minor Non-breaking change that can go into the next minor version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants