mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-15 05:36:39 +00:00
32 lines
957 B
TypeScript
32 lines
957 B
TypeScript
import test from 'ava';
|
|
import Scanner from '../../src/scanner/Scanner';
|
|
import { IMaterializeOptions } from '../../src/types';
|
|
import { getFromFixtures } from '../helpers';
|
|
|
|
const multiExportedComptPath = getFromFixtures('multiple-exported-component');
|
|
const singleExportedComptPath = getFromFixtures('single-exported-component');
|
|
|
|
test.serial('scan multiple exported component', async t => {
|
|
const scanner = new Scanner({
|
|
cwd: multiExportedComptPath,
|
|
entry: multiExportedComptPath,
|
|
accesser: 'local',
|
|
isExportedAsMultiple: true,
|
|
} as IMaterializeOptions);
|
|
|
|
const actual = await scanner.scan();
|
|
t.snapshot(actual);
|
|
});
|
|
|
|
test.serial('scan single exported component', async t => {
|
|
const scanner = new Scanner({
|
|
cwd: singleExportedComptPath,
|
|
entry: singleExportedComptPath,
|
|
accesser: 'local',
|
|
isExportedAsMultiple: false,
|
|
} as IMaterializeOptions);
|
|
|
|
const actual = await scanner.scan();
|
|
t.snapshot(actual);
|
|
});
|