-
Notifications
You must be signed in to change notification settings - Fork 760
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
custom expectations #16
Comments
you can augment the |
but isn't Test module 'internal' in supertest? |
nope it's exported |
nvm I lied, it's not exported right now but we can do that |
This is exported now. 0956c37 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I was wondering, how bad it would be if supertest would export lib/Test to allow add custom (application specific) expectations?
My use case is that I want to test expressjs routes and need to test in many places thinks like 'unauthorized', 'unauthenticated', 'owneronly' conditions for many urls, so currently I do:
but would prefer something like:
Pros of that approach is that I have to test such things for many urls, so test code would be more readable and in case I'd change middleware Error I wouldn't have to replace it as well in 'x' places in tests.
Cheers,
Tadek
The text was updated successfully, but these errors were encountered: