forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.test.ts
More file actions
43 lines (37 loc) · 1.05 KB
/
cli.test.ts
File metadata and controls
43 lines (37 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { run } from '../src/cli';
describe('cli', () => {
// standalone 模式下不需要测试 cli
if (process.env.TEST_TARGET === 'standalone') {
it('should ignore', () => {
expect(true).toBe(true);
});
return;
}
it('should works for the default example-schema.json', async () => {
const res = await run(['example-schema.json'], {
solution: 'icejs',
output: './demo',
});
expect(res).toBe(0);
});
it('should works for the default example-schema.json5', async () => {
const res = await run(['example-schema.json5'], {
solution: 'icejs',
output: './demo',
});
expect(res).toBe(0);
});
it('should returns error for no schema file', async () => {
const res = await run([], {
solution: 'icejs',
output: './demo',
});
expect(res).not.toBe(0);
});
it('should returns error for to many schema files', async () => {
const res = await run(['example-schema.json', 'example-schema.json5'], {
solution: 'icejs',
});
expect(res).not.toBe(0);
});
});