1

Using env specific configuration, is it possible for me to specify which env should be the default when no env is specified?

For example, I currently have something like:

karate-config.js

function fn() {
    return {};
}

karate-config-local.js

function fn() {
    karate.log('karate.env is:', karate.env);
    return config = {
        env: karate.env,
        # local config
    }
}

karate-config-dev.js

function fn() {
    karate.log('karate.env is:', karate.env);
    return config = {
        env: karate.env,
        # dev config
    }
}

Is it possible for me to add something to karate-config.js so that karate-config-local.js is used when no env is specified via karate.env?

mip
  • 1,886
  • 8
  • 26
  • 32

1 Answers1

0

No sorry, karate-config.js is the default.

That said, you can invent schemes of your own by conditionally reading JS or JSON files. Add them to the returned JSON object and you're done.

This answer may give you ideas: Pass Json to karate-config.js file

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