08ea5fbe98
添加用户管理视图、API和状态管理文件
36 lines
896 B
JavaScript
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 };
|