Sample stub:
{
"predicates": [{
"and": [
{
"equals": {
"path": "/test1"
,"method": "GET"
}
}
]
}]
,"responses": [
{ "inject": "<%- stringify(filename, 'code/injectTestResponse.js') %>" }
]
}
Just like /test1 and its corresponding response injection JS file, there can be a few.
Even if I have a 'require' statement within 'code/injectTestResponse.js' - it errors out
when that API call is made:
error: [http:4545 xxx] injection X=> SyntaxError: Unexpected token 'const'
Really looking for a way to have code-reuse within my script injections !
YD