Replies: 1 comment 2 replies
-
It looks like you are experiencing the limits of the Postman syntax. My suggestion would be to use contentTests with the "contains" check. You want to validate the error message, not the exact response.
The content check result will be the same, since it will tell you that error message is returned as expected, but this will make the test more generic and less complicated. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be handy if contentTests like this one:
Generated a pm.test that used the backtick syntax to represent the string in the test instead of double quotes as it does now
For example in the below I simply replaced the quote marks with back ticks:
And this test passes.
I can't think of any reason why using backticks as the default all the time would cause problems, but I readily admit I may not be thinking through all the use cases!
An alternate approach might be to support a new keyword, ie: using
templateLiteral
, instead ofvalue
could use the backticks.Beta Was this translation helpful? Give feedback.
All reactions