2021-12-21 09:51:43 +08:00

16 lines
453 B
TypeScript

import path from 'path';
import simulate from 'miniprogram-simulate';
test('should render demo and match snapshot', () => {
try {
const id = simulate.load(path.resolve(__dirname, '../demo/index'), {
rootPath: path.resolve(__dirname, '../../'),
});
const comp = simulate.render(id);
comp.attach(document.createElement('parent-wrapper'));
expect(comp.toJSON()).toMatchSnapshot();
} catch (e) {
console.error(e);
}
});