mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 17:48:13 +00:00
test: 💍 code generator 的测试应该只对目录有效
This commit is contained in:
parent
36c486b9cd
commit
7ad9f7563c
@ -12,7 +12,7 @@ import { IProjectSchema } from '../src/types/schema';
|
||||
|
||||
const TEST_CASES_DIR = path.join(__dirname, '../test-cases/rax-app');
|
||||
|
||||
fs.readdirSync(TEST_CASES_DIR).forEach(defineTest);
|
||||
getSubDirectoriesSync(TEST_CASES_DIR).forEach(defineTest);
|
||||
|
||||
function defineTest(caseDirName: string) {
|
||||
test(`rax-app ${caseDirName} should works`, async (t) => {
|
||||
@ -115,3 +115,9 @@ function colorizeDiffOutput(output: string): string {
|
||||
})
|
||||
.join('\n');
|
||||
}
|
||||
|
||||
function getSubDirectoriesSync(baseDir: string) {
|
||||
return fs
|
||||
.readdirSync(baseDir)
|
||||
.filter((dirOrFileName: string) => fs.statSync(path.join(baseDir, dirOrFileName)).isDirectory());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user