woocommerce/packages/js/e2e-environment/utils/app-name.js

28 lines
491 B
JavaScript
Raw Permalink Normal View History

2020-10-21 17:25:13 +00:00
/**
* External dependencies
*/
const path = require( 'path' );
/**
* Internal dependencies
*/
const { getTestConfig } = require( './test-config' );
2020-10-21 17:25:13 +00:00
const getAppRoot = require( './app-root' );
const getAppName = () => {
const testConfig = getTestConfig();
if ( testConfig.appName ) {
return testConfig.appName;
}
return getAppBase();
};
const getAppBase = () => {
2020-10-21 17:25:13 +00:00
const appRoot = getAppRoot();
return path.basename( appRoot );
}
2020-10-21 17:25:13 +00:00
module.exports = {
getAppName,
getAppBase,
};