Open Yuan-ZW opened 2 weeks ago
看起来是少了个依赖,导致报错了,您可以直接本地安装上看看 不过现在内部的包还没有构建完整的测试用例,你run test的诉求是什么呢🤔
就是我发现个bug,原本想按你们的PR规范里的步骤提个pr
具体bug就是polyline和菱形(多边形)的交点问题:
我翻了下源码,发现你们其实有相应的实现 不过由于这段代码逻辑不严谨导致功能没生效: https://github.com/didi/LogicFlow/blob/e9f097c1532874c83c14ffefe01215e3be8bb278/packages/core/src/algorithm/edge.ts#L52-L69
想改一下这个函数,还有它对应的测试用例
了解😄,升2.0之后 test 指令的逻辑还没来得及加上,这个pr我们今天看下
解决了依赖问题后还有新的报错:
PS D:\projects\js\LogicFlow> pnpm test -- packages\core\__tests__\algorithm\egde.test.ts
> logicflow@ test D:\projects\js\LogicFlow
> jest "packages\\core\\__tests__\\algorithm\\egde.test.ts"
FAIL packages/core/__tests__/algorithm/egde.test.ts
● Test suite failed to run
TypeError: Cannot read properties of undefined (reading 'Point')
7 | import { GraphModel, BezierEdgeModel } from '../../model'
8 |
> 9 | import Point = LogicFlow.Point
| ^
10 |
11 | type IProps = {
12 | graphModel: GraphModel
at Object.Point (packages/core/src/view/overlay/BezierAdjustOverlay.tsx:9:26)
at Object.require (packages/core/src/view/overlay/index.ts:2:1)
at Object.require (packages/core/src/options.ts:6:1)
at Object.require (packages/core/src/util/animation.ts:2:1)
at Object.require (packages/core/src/util/index.ts:1:1)
at Object.require (packages/core/src/index.ts:5:1)
at Object.require (packages/core/src/LogicFlow.tsx:3:1)
at Object.require (packages/core/src/algorithm/edge.ts:1:1)
at Object.require (packages/core/__tests__/algorithm/egde.test.ts:1:1)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 5.274 s
Ran all test suites matching /packages\\core\\__tests__\\algorithm\\egde.test.ts/i.
ELIFECYCLE Test failed. See above for more details.
PS D:\projects\js\LogicFlow>
有点怀疑是不是循环引用的原因🤔
发生了什么?
node: v20.10.0 pnpm: 9.12.1 仓库版本: e9f097c
完整日志:
logicflow/core版本
2.0.6
logicflow/extension版本
2.0.10
logicflow/engine版本
No response
浏览器&环境
No response