mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-04-27 01:22:18 +08:00
38 lines
992 B
JavaScript
38 lines
992 B
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* External dependencies
|
|
*/
|
|
const { execSync } = require( 'child_process' );
|
|
|
|
const commands = [
|
|
{
|
|
description: 'Activate storefront theme',
|
|
command: 'wp-env run tests-cli wp theme deactivate storefront',
|
|
},
|
|
{
|
|
description: 'Uninstall WooCommerce Payments',
|
|
command:
|
|
'wp-env run tests-cli -- wp plugin delete woocommerce-payments',
|
|
},
|
|
{
|
|
description: 'Uninstall WooCommerce',
|
|
command: 'wp-env run tests-cli -- wp plugin delete woocommerce',
|
|
},
|
|
];
|
|
|
|
console.log( 'Cleaning test environment...\n' );
|
|
|
|
commands.forEach( ( item, index ) => {
|
|
try {
|
|
console.log( `${ index + 1 }. ${ item.description }` );
|
|
execSync( item.command, { stdio: 'inherit' } );
|
|
console.log( '✅ Success\n' );
|
|
} catch ( error ) {
|
|
console.error( `❌ Failed: ${ item.description }` );
|
|
console.error( `Command: ${ item.command }` );
|
|
console.error( `Error: ${ error.message }\n` );
|
|
process.exit( 1 );
|
|
}
|
|
} );
|
|
|
|
console.log( '🧹 Test environment clean complete!' );
|