mdasberg / ng-apimock

Node plugin that provides the ability to use scenario based api mocking: for local development for protractor testing
MIT License
99 stars 26 forks source link

ng-apimock use global variables in mocks without double quotes #57

Open pulla2908 opened 6 years ago

pulla2908 commented 6 years ago

I have added ng-apimock to our Angular project. We have successfully created first mock definitions and wrote tests with protractor.

Now we want to start using global variables in mock definitions. As it seems I always have to use double quotes for variables. But in my case I need a number and not a string.

I have created a question on stackoverflow with a sample already, you can find it here

Any ideas how to get this working?

ckrul commented 1 year ago

I had the same issue, however, it was caused by the variable within the preset file that was accidentally a string. By removing the quotes here, the apimock response field turned into a number even mock field containing the variable is a quoted string.