auto-unit-test-cli
v0.0.6
Published
jest单测自动化生成工具
Downloads
8
Readme
aut-cli
jest单测自动化生成工具
- 安装
npm install auto-unit-test-cli -g
- 生成单测
aut-beta init your_file_or_directory_path
- 自定义单测模版
aut-beta template
/** example **/
const componentTemplate = (functionName, args) => (
`describe('${functionName}', () => {
it('case by default', () => {
const props = ${args[0]};
const { asFragment } = render(<${functionName} {...props} />);
expect(asFragment()).toMatchSnapshot();
});
});`
)
module.exports = componentTemplate;
- 单测生成范围
当前只命中ReactCompoennt 和 工具函数,reactHook在规划中