Request Matching with '=' #64
Replies: 2 comments 4 replies
-
Hi Ashanka, Until recently I too was under assumption that this would work, but it appears handlebars' if helper does not support comparisions. (I need to update Camouflage docs) See https://stackoverflow.com/questions/34252817/handlebarsjs-check-if-a-string-is-equal-to-a-value There are two ways to achieve your use case:
Since this is such a common use case, I think it would be best to have a helper included as part of Camouflage. It would be great if you could create a feature request issue for the same. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hi Shubhendu,
Greetings!
I have recently started using https://testinggospels.github.io/camouflage/ and I am finding it very useful.
I have one query here, In the request matching section Request-match
When I try to perform
{{#if request.query.task='1234'}}
in myGET.mock
file I see below error:Expecting 'CLOSE_RAW_BLOCK', 'CLOSE', 'CLOSE_UNESCAPED', 'OPEN_SEXPR', 'CLOSE_SEXPR', 'ID', 'OPEN_BLOCK_PARAMS', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', 'SEP', got 'EQUALS'.
Do you have any suggestions around this? Basically, I have different task-id value and I want to send mock based on the Id. However
=
doesn't seem to work for me.Beta Was this translation helpful? Give feedback.
All reactions