[英]Defining two o more functions in karate-config.js
My karate-config.js is:我的 karate-config.js 是:
function config(){
return karate.read('classpath:' + env_file());
}
function env_file(){
var env_file = karate.env;
if(!env_file){
env_file = 'local.yml';
}
return 'env/' + env_file;
}
That was working fine until I upgraded my Java version to 17.在我将 Java 版本升级到 17 之前,一切正常。
Now I'm getting the following exception:现在我收到以下异常:
org.graalvm.polyglot.PolyglotException: SyntaxError: Unnamed:5:0 Expected ) but found function
Is it possible now to define two functions in the same file?现在可以在同一个文件中定义两个函数吗?
Thanks in advance.提前致谢。
No. It was never supposed to have been supported, I'm surprised it worked.不,它从来不应该得到支持,我很惊讶它起作用了。
Also refer: https://github.com/karatelabs/karate#multiple-functions-in-one-file另请参阅: https://github.com/karatelabs/karate#multiple-functions-in-one-file
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.