NervJS / taro-test-utils

多端单测工具
MIT License
10 stars 4 forks source link

Taro3.6.24模板项目创建后运行测试报错 #38

Open tangbzai opened 7 months ago

tangbzai commented 7 months ago

问题描述:

taro 3.6.24版本的模板项目运行测试会报找不到history的错误。

Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0 total Time: 15.156 s Ran all test suites.  ELIFECYCLE  Test failed. See above for more details.


### 复现步骤:
1. 使用`@tarojs/cli`创建模板项目 (react+pnpm+ts+less+github+默认模板)
2. 项目创建完成并安装完成依赖后运行`pnpm test`
jxgzzztang commented 6 months ago

有解决方案吗?

tangbzai commented 6 months ago

有解决方案吗?

目前没有很好的解决方案,只能回退Taro版本到3.6.22或者不使用这个库。

tangbzai commented 6 months ago

我目前定位到问题是出在 Taro的 #15094 pr 导致的报错。

这个合并里修改了@tarojs/routercreateRouter 函数(在函数前面增加了一个history参数)而这个库的代码未做对应修改导致的问题。 具体代码片段:packages/taro-router/src/router/spa.ts 这个库需要调整的位置:

@heiazu 麻烦大佬看看如何修改

jxgzzztang commented 6 months ago

有解决方案吗?

目前没有很好的解决方案,只能回退Taro版本到3.6.22或者不使用这个库。

那只能暂时回退版本了

kunkuntang commented 3 months ago

还没解决吗。。。

QuentinHsu commented 2 months ago

Amazing!

"@tarojs/taro": "3.6.34" 了,还没能解决这个问题 😭

wangzhengbo commented 1 month ago

这个库都没见维护了