mirror of
https://github.com/appium/appium.git
synced 2026-02-12 21:10:10 -06:00
- `@appium/test-support` now exports the e2e setup for plugins, and e2e/unit suites for drivers from base-driver. it also generates declarations. - `appium` exports this as `appium/test`. - The `capability.spec.js` unit test for basedriver now avoids spying on the "global" logger, due to test flake. It now spies directly on the function which calls the global logger. (@mykola_mokhnach) - removed homebrew ansi-stripping code from `test-support` and replaced with `@colors/colors` - type fixes and refactors for `@appium/test-support` - type fixes for `appium` - simplify `lib/index.js` of `@appium/base-driver`
17 lines
377 B
JavaScript
17 lines
377 B
JavaScript
/**
|
|
* Creates Mocha "before each" and "after each" hooks to restore `process.env` after every test.
|
|
*/
|
|
function stubEnv() {
|
|
/** @type {NodeJS.ProcessEnv} */
|
|
let envBackup;
|
|
beforeEach(function beforeEach() {
|
|
envBackup = process.env;
|
|
process.env = {...process.env};
|
|
});
|
|
afterEach(function afterEach() {
|
|
process.env = envBackup;
|
|
});
|
|
}
|
|
|
|
export {stubEnv};
|