3

My karate-config.js is:

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.

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.

Talha Tayyab
  • 8,111
  • 25
  • 27
  • 44
italktothewind
  • 1,950
  • 2
  • 28
  • 55

1 Answers1

1

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

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248