lowcode-engine/modules/code-generator/scripts/test-standalone.js

18 lines
650 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 测试 standalone 模式的基本功能
// 注1指定文件测试就直接在后面加文件: node scripts/test-standalone.js tests/public/rax-app.test.ts
// 注2指定测试用例就直接在后面加`-t xxx`: node scripts/test-standalone.js tests/public/rax-app.test.ts -t demo01
const { spawnSync } = require('child_process');
// 一定要先构建
spawnSync('npm', ['run', 'build:standalone'], { shell: true, stdio: 'inherit' });
// 然后只执行特定的一些测试用例
spawnSync('npx', ['jest', ...process.argv.slice(2)], {
env: {
...process.env,
TEST_TARGET: 'standalone',
},
shell: true,
stdio: 'inherit',
});