QA Wolf logo

QA Wolf

setEnvironmentVariable(name, value)

Create or update an environment variable.

This is useful to store values you need for future test runs. For example if you are testing reset password, you will need the new password for future test runs.

await setEnvironmentVariable("password", "updated password");
expect(process.env.PASSWORD).toBe("updated password");


name (string): Name of the environment variable. This will be formatted to UPPER_SNAKE_CASE.

value (string): Value of the environment variable.

Returns: Promise<void>