core/lib/runner.js
function createContext(script) {
  const INITIAL_CONTEXT = {
    vars: {
      target: script.config.target,
      $environment: script._environment,
      $processEnvironment: process.env
    },
    funcs: {
      $randomNumber: $randomNumber,
      $randomString: $randomString,
      $template: input => engineUtil.template(input, { vars: result.vars })
    }
  };

  let result = _.cloneDeep(INITIAL_CONTEXT);

  // variables from payloads:
  const variableValues1 = datafileVariables(script);
  Object.assign(result.vars, variableValues1);
  // inline variables:
  const variableValues2 = inlineVariables(script);
  Object.assign(result.vars, variableValues2);

  result._uid = uuid.v4();
  result.vars.$uuid = result._uid;
  return result;
}
function createContext(script) {
  const INITIAL_CONTEXT = {
    vars: {
      target: script.config.target,
      $environment: script._environment,
      $processEnvironment: process.env
    },
    funcs: {
      $randomNumber: $randomNumber,
      $randomString: $randomString,
      $template: input => engineUtil.template(input, { vars: result.vars })
    }
  };

  let result = _.cloneDeep(INITIAL_CONTEXT);

  // variables from payloads:
  const variableValues1 = datafileVariables(script);
  Object.assign(result.vars, variableValues1);
  // inline variables:
  const variableValues2 = inlineVariables(script);
  Object.assign(result.vars, variableValues2);

  result._uid = uuid.v4();
  result.vars.$uuid = result._uid;
  return result;
}
function createContext ( script ) { const INITIAL_CONTEXT = { vars : { target : script . config . target , $environment : script . _environment , $processEnvironment : process . env } , funcs : { $randomNumber : $randomNumber , $randomString : $randomString , $template : input => engineUtil . template ( input , { vars : result . vars } ) } } ; let result = _ . cloneDeep ( INITIAL_CONTEXT ) ; // variables from payloads: const variableValues1 = datafileVariables ( script ) ; Object . assign ( result . vars , variableValues1 ) ; // inline variables: const variableValues2 = inlineVariables ( script ) ; Object . assign ( result . vars , variableValues2 ) ; result . _uid = uuid . v4 ( ) ; result . vars . $uuid = result . _uid ; return result ; }
Create initial context for a scenario.
Create initial context for a scenario .