woocommerce/packages/js/e2e-utils/src/system-environment.js

17 lines
394 B
JavaScript
Raw Normal View History

2021-08-30 19:23:54 +00:00
import { withRestApi } from './flows';
/**
* Uses the WooCommerce API to get the environment context.
*/
export const getEnvironmentContext = async () => {
try {
const environment = await withRestApi.getSystemEnvironment();
return {
wpVersion: environment.wp_version,
wcVersion: environment.version,
}
} catch ( error ) {
// Prevent an error here causing tests to fail.
}
}