mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-04-28 03:09:16 +08:00
34 lines
1,022 B
JavaScript
34 lines
1,022 B
JavaScript
#!/usr/bin/env node
|
|
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!');
|