Files
everything-is-suitable/everything-is-suitable-uniapp/e2e/miniprogram/run-tests.js
T
张翔 08ea5fbe98 feat(admin): 添加用户管理相关文件
添加用户管理视图、API和状态管理文件
2026-03-28 14:37:29 +08:00

36 lines
896 B
JavaScript

const { spawn } = require('child_process');
const path = require('path');
const PLAYWRIGHT_CONFIG = path.join(__dirname, '../../playwright.miniprogram.config.ts');
function runTests() {
console.log('Starting mini program tests...');
console.log(`Using Playwright config: ${PLAYWRIGHT_CONFIG}`);
const playwright = spawn('npx', ['playwright', 'test', '--config', PLAYWRIGHT_CONFIG], {
stdio: 'inherit',
shell: true,
});
playwright.on('close', (code) => {
if (code === 0) {
console.log('Mini program tests passed!');
process.exit(0);
} else {
console.error(`Mini program tests failed with code ${code}`);
process.exit(code);
}
});
playwright.on('error', (error) => {
console.error('Failed to start Playwright:', error);
process.exit(1);
});
}
if (require.main === module) {
runTests();
}
module.exports = { runTests };