mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-01 13:40:41 +00:00
1. fix bug of failing to resolve RFC components
2. support transforming function args
3. fix bug of oneOfType
4. fix bug of crash when circular parsing
5. fix bug of union
6. support tuple
7. fix bug of builtin type parsing
8. fix bug of false positive component identification
9. fix bug of entry resolving
54 lines
1.3 KiB
TypeScript
54 lines
1.3 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');
|
|
const tsComponent2 = getFromFixtures('ts-component2');
|
|
|
|
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);
|
|
});
|
|
|
|
test('ts component 2 by local', async t => {
|
|
const options: IMaterializeOptions = {
|
|
entry: tsComponent2,
|
|
accesser: 'local',
|
|
};
|
|
|
|
const actual = await parse(options);
|
|
|
|
t.snapshot(actual);
|
|
});
|