-
Notifications
You must be signed in to change notification settings - Fork 506
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
refactor: add packages/tdesign-vue-next for test #5021
Conversation
问题:tsc 编译错误当前的 tsconfig.json 编译 tsc-es 等会出现如下问题 原因是:tsconfig.json 中
解决方案:临时新增一个用于编译
|
2684ac0
to
acd48b4
Compare
哦,看到了,这就试试 然后还有另一种方式可以解决:这是 {
root: '../../../',
test: {
coverage: {
reportsDirectory: 'packages/tdesign-vue-next/test/coverage',
}
}
} 更新:2025 年 2 月 16 日 12:44
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
翻看具体内容,发现执行了相同的三次,导致生成snapshot比原数量增加2倍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 这个 PR 的性质是?
🔗 相关 Issue
#5020
💡 需求背景和解决方案
如 issue 描述:完善 packages/tdesign-vue-next 测试
在这之前,需要考虑一个问题,test 应该怎么放置。
放置在 packages/tdesign-vue-next/test
按照之前的讨论,应是 packages/tdesign-vue-next/test 这样的存在,test 里面包含 vitest.config.js、test_setup.js 和 unit 和 snap 的配置。
这种方式的优点在于出口文件和脚本统一。
那么问题是:packages/tdesign-vue-next/test 是否需要作为一个子应用存在呢?
如果作为子应用存在,其:
如果不作为子应用存在,其:
单独走包,类似于 build
好处在于根 package.json 脚本清晰一些
2025 年 2 月 15 日 13:00 补充结论
和 @uyarn 讨论后结论如下:
和 build 不同的是,build 并不存在依赖上的差异,不同的出口的 build 只是在所使用的插件和配置(rollup.config.js)上的差异。但 test 不一样,不同的出口的 test 依赖上存在差异,例如
@vue/test-utils vue vue-router
等,因此 test 是需要放置出口文件里的。至于是否作为子应用,考虑依赖清晰,子应用会更合适
最外层已经有了脚本命令,可以说这里是不需要了
执行事项如下:
📝 更新日志