You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
testFunction bodies are sent directly to Postman for execution. However Postman doesn't support using custom functions or libraries out of these testFunction bodies scopes.
We may expand these functions in testFunctions. This concept is coming from lisp macros.
For example the test below should print 3 when given to jetman.execute method:
function helperA(){
x = 1;
}
function helperB(){
helperA();
y = 2;
}
function testFunction(){
helperB();
z = x + y;
console.log(z);
}
request = {
'name': 'Root endpoint works'
'url': 'localhost:9090'
}
exports.run = function() {
jetman.send(request, testFunction);
}
This could be achieved if the called functions in testFunction are expanded recursively beforehand. Then we can pass the following body to Postman after expansion:
{
{
x = 1;
}
y = 2;
}
z = x + y;
console.log(z);
This feature could be applied to external JS libraries too. Interest for such a feature is already expressed here: postmanlabs/newman#153
The text was updated successfully, but these errors were encountered:
testFunction
bodies are sent directly to Postman for execution. However Postman doesn't support using custom functions or libraries out of thesetestFunction
bodies scopes.We may expand these functions in testFunctions. This concept is coming from lisp macros.
For example the test below should print
3
when given tojetman.execute
method:This could be achieved if the called functions in
testFunction
are expanded recursively beforehand. Then we can pass the following body to Postman after expansion:This feature could be applied to external JS libraries too. Interest for such a feature is already expressed here: postmanlabs/newman#153
The text was updated successfully, but these errors were encountered: