mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 09:41:57 +00:00
1. 修复eslint问题 2. instanceOf => any 3. 修复node类型解析失败问题 Link: https://code.aone.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/codereview/3716330 * refactor: material parser code style
42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import test from 'ava';
|
|
import parse from '../src';
|
|
import { IMaterializeOptions } from '../src/types';
|
|
import { getFromFixtures } from './helpers';
|
|
|
|
const multiExportedComptPath = getFromFixtures('multiple-exported-component');
|
|
const singleExportedComptPath = getFromFixtures('single-exported-component');
|
|
const tsComponent = getFromFixtures('ts-component');
|
|
|
|
test('materialize single exported component by local', async t => {
|
|
const options: IMaterializeOptions = {
|
|
entry: singleExportedComptPath,
|
|
accesser: 'local',
|
|
};
|
|
|
|
const actual = await parse(options);
|
|
|
|
t.snapshot(actual);
|
|
});
|
|
|
|
test('materialize multiple exported component by local', async t => {
|
|
const options: IMaterializeOptions = {
|
|
entry: multiExportedComptPath,
|
|
accesser: 'local',
|
|
};
|
|
|
|
const actual = await parse(options);
|
|
|
|
t.snapshot(actual);
|
|
});
|
|
|
|
test('ts component by local', async t => {
|
|
const options: IMaterializeOptions = {
|
|
entry: tsComponent,
|
|
accesser: 'local',
|
|
};
|
|
|
|
const actual = await parse(options);
|
|
|
|
t.snapshot(actual);
|
|
});
|