Open DevanXU opened 1 year ago
没有太关注单测这边,单测用列,也没有及时更新,现在卡点问题是什么呢?
无法跑单测啊,连带与FormRender无关的组件都可能失败。出现下面这个错误,在我提供的Demo可以复现这个问题的。
FAIL src/ConfigBox.test.tsx [ src/ConfigBox.test.tsx ]
SyntaxError: Cannot use import statement outside a module
❯ Object.compileFunction node:vm:360:18
❯ Object.
Module /Users/devan/src/tmp/formrender/node_modules/antd/es/button/style/index.js:1 seems to be an ES Module but shipped in a CommonJS package. You might want to create an issue to the package "antd" asking them to ship the file in .mjs extension or add "type": "module" in their package.json.
As a temporary workaround you can try to inline the package by updating your config:
// vitest.config.js export default { test: { server: { deps: { inline: [ "antd" ] } } } }
1.依赖仓库的版本(Dependencies versions):
2.问题描述(Bug description): vitest测试基于
FormRender
的组件失败3.出现问题的 schema demo(Reproduction schema demo):
4.最小复现 demo(Reproduction demo):https://github.com/DevanXU/form-render-issue
运行
$ yarn test
即可复现form-render demo https://codesandbox.io/s/unruffled-flower-jl78h table-render demo https://codesandbox.io/s/sweet-euler-bdoty fr-generator demo https://codesandbox.io/s/s13sh