forked from gzzfw/frontEnd/gzDyh

liuwh
2024-09-13 9f705a54328c4b59ad9566c521bc6e0e7577acb3
1
2
3
4
5
6
7
8
9
10
11
import path from 'path';
import simulate from 'miniprogram-simulate';
 
test('should render demo and match snapshot', () => {
  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();
});