gengyang 64c9daa1f4 refactor: 💡 refactor with react-docgen
BREAKING CHANGE: 🧨 use react-docgen to replace parser
2020-03-16 16:32:41 +08:00

30 lines
1023 B
TypeScript

import test from 'ava';
import LocalAccesser from '../../src/accesser/LocalAccesser';
import { IMaterializeOptions } from '../../src/types';
import { getFromFixtures } from '../helpers';
const multiExportedComptPath = getFromFixtures('multiple-exported-component');
const singleExportedComptPath = getFromFixtures('single-exported-component');
test.serial('access single exported component by local', async t => {
const options: IMaterializeOptions = {
entry: singleExportedComptPath,
accesser: 'local',
isExportedAsMultiple: false,
};
const accesser = new LocalAccesser(options);
const actual = await accesser.access();
t.snapshot(actual);
});
// test.serial('access multiple exported component by local', async t => {
// const options: IMaterializeOptions = {
// entry: multiExportedComptPath,
// accesser: 'local',
// isExportedAsMultiple: true,
// };
// const accesser = new LocalAccesser(options);
// const actual = await accesser.access();
// t.snapshot(actual);
// });