@wordpress/e2e-test-utils
Version:
End-To-End (E2E) test utils for WordPress.
18 lines (17 loc) • 481 B
JavaScript
/**
* Internal dependencies
*/
import { getCurrentUser } from './get-current-user';
import { loginUser } from './login-user';
import { WP_USERNAME } from './shared/config';
/**
* Switches the current user to whichever user we should be
* running the tests as (if we're not already that user).
*/
export async function switchUserToTest() {
if ((await getCurrentUser()) === WP_USERNAME) {
return;
}
await loginUser();
}
//# sourceMappingURL=switch-user-to-test.js.map