Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buidscript test 命令报错 #122

Closed
JackLian opened this issue Dec 22, 2022 · 2 comments
Closed

buidscript test 命令报错 #122

JackLian opened this issue Dec 22, 2022 · 2 comments

Comments

@JackLian
Copy link

复现方式:

  1. 仓库: https://code.alibaba-inc.com/liujuping.liujupin/build-plugin-component-bug/tree/master

  2. 执行

tnpm i
npm run test
  1. 提示错误信息

Screen Shot 2022-12-22 at 19 06 13

  1. 注释掉 line 11 ,错误会消失

期望结果

npm run test 可以正常

仓库是通过这个文档创建的
image

@luhc228
Copy link
Member

luhc228 commented Dec 26, 2022

目前先在项目根目录下添加 babel.config.js。(另外 jest 版本要在 ^26)

module.exports = {
  plugins: [
    ['@babel/plugin-proposal-decorators', { version: 'legacy' }],
    [require.resolve('@babel/plugin-proposal-class-properties'), { loose: true }],
  ],
};

单测这块 build-plguin-components 能力不是很完善的,如果有更多的需求,可以使用 icepkg

@luhc228 luhc228 closed this as completed Dec 26, 2022
@JackLian
Copy link
Author

感谢~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants