-
Notifications
You must be signed in to change notification settings - Fork 4.9k
fix: typo #17928
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
fix: typo #17928
Conversation
Walkthrough本次变更主要聚焦于 Taro 相关包的测试体系升级与代码规范修正。具体包括将测试框架从 Jest 迁移至 Vitest,新增和完善了大量 Vitest 单元测试,修复了各处拼写错误(如 DESTORY→DESTROY、Scaner→Scanner、isParentBinded→isParentBound 等),统一参数命名风格,完善了 polyfill 实现,并同步调整了相关文档和配置文件,删除了部分旧的配置和 changelog 文件。 Changes
Sequence Diagram(s)sequenceDiagram
participant TestRunner as Vitest
participant Setup as setup.ts
participant Source as 源代码模块
participant Polyfill as Polyfill
participant Tests as 各测试用例
TestRunner->>Setup: 运行测试前初始化环境变量与全局特性
TestRunner->>Polyfill: 加载并应用 Array/DOM polyfill
TestRunner->>Source: 加载被测模块
TestRunner->>Tests: 执行单元测试
Tests->>Source: 调用/断言模块行为
Tests->>Polyfill: 验证 polyfill 功能
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Nitpick comments (3)
packages/taro-platform-harmony/src/runtime-framework/react/native-page.ts (1)
418-428
: 为reactDOM
参数补充类型,保持一致性此处把参数统一为
reactDOM
很好,但依旧缺少类型声明,TS 检查时会丢失静态约束。-function createNativeComponentConfig ( - Component, - react: typeof React, - reactDOM, - componentConfig +function createNativeComponentConfig ( + Component: any, + react: typeof React, + reactDOM: typeof ReactDOM, + componentConfig: any )packages/taro-platform-harmony-cpp/src/runtime/framework/native-page.ts (1)
448-456
: 未声明类型的reactDOM
参数与上面的 React 版实现相同,这里也建议显式标注参数类型,避免后续修改导致的类型漂移。
-export function createNativeComponentConfig ( - Component, - compName: string, - react: typeof React, - reactDOM, - componentConfig: any = {} +export function createNativeComponentConfig ( + Component: any, + compName: string, + react: typeof React, + reactDOM: typeof ReactDOM, + componentConfig: any = {} )packages/taro-framework-react/src/runtime/connect-native.ts (1)
346-354
:reactDOM
参数缺少类型声明三个工厂函数(
createH5NativeComponentConfig
、createNativeComponentConfig
等)均引入了未经类型限定的reactDOM
,与其他文件保持一致可读性更佳。-function createH5NativeComponentConfig ( - Component, - react: typeof React, - reactDOM: typeof ReactDOM, +function createH5NativeComponentConfig ( + Component: any, + react: typeof React, + reactDOM: typeof ReactDOM, )其余类似处同理。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
packages/eslint-plugin-taro/yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (18)
packages/eslint-plugin-taro/CHANGELOG.md
(0 hunks)packages/shared/src/shortcuts.ts
(1 hunks)packages/taro-components/CHANGELOG.md
(0 hunks)packages/taro-framework-react/src/runtime/connect-native.ts
(2 hunks)packages/taro-platform-harmony-cpp/src/runtime/framework/native-page.ts
(2 hunks)packages/taro-platform-harmony-cpp/src/runtime/framework/page.ts
(1 hunks)packages/taro-platform-harmony/src/runtime-framework/react/native-page.ts
(2 hunks)packages/taro-platform-harmony/src/runtime-framework/react/page.ts
(1 hunks)packages/taro-platform-harmony/src/runtime-framework/solid/page.ts
(1 hunks)packages/taro-router/README.md
(2 hunks)packages/taro-runtime/src/__tests__/location.spec.js
(2 hunks)packages/taro-runtime/src/bom/history.ts
(1 hunks)packages/taro-runtime/src/bom/location.ts
(1 hunks)packages/taro-runtime/src/bom/window.ts
(1 hunks)packages/taro-runtime/src/constants/index.ts
(1 hunks)packages/taro-runtime/src/dsl/common.ts
(1 hunks)packages/taroize/src/template.ts
(2 hunks)packages/taroize/src/wxml.ts
(15 hunks)
💤 Files with no reviewable changes (2)
- packages/eslint-plugin-taro/CHANGELOG.md
- packages/taro-components/CHANGELOG.md
🧰 Additional context used
🧠 Learnings (12)
packages/taro-runtime/src/bom/location.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-platform-harmony/src/runtime-framework/solid/page.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-platform-harmony-cpp/src/runtime/framework/page.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-platform-harmony/src/runtime-framework/react/page.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-runtime/src/dsl/common.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-router/README.md (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-runtime/src/bom/window.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-runtime/src/__tests__/location.spec.js (1)
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taroize/src/wxml.ts (3)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: Single-Dancer
PR: NervJS/taro#17653
File: packages/taro-components-advanced/src/components/water-flow/node.ts:83-95
Timestamp: 2025-05-06T06:55:44.077Z
Learning: 在 Taro 的 getRectSizeSync 函数中,如果找不到指定的节点,函数会一直处于 pending 状态而不是抛出错误。在这种情况下,使用 try/catch 处理不够充分,需要添加超时处理如 Promise.race 来避免无限等待。
Learnt from: Single-Dancer
PR: NervJS/taro#17653
File: packages/taro-components-advanced/src/components/water-flow/node.ts:83-95
Timestamp: 2025-05-06T06:55:44.077Z
Learning: 在 Taro 的 water-flow 组件中,getRectSizeSync 函数如果找不到指定的节点,会一直处于 pending 状态而不是抛出错误。在这种情况下,应该使用 Promise.race 添加超时机制,而不是仅依赖 try/catch 来处理错误。
packages/taro-platform-harmony/src/runtime-framework/react/native-page.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-platform-harmony-cpp/src/runtime/framework/native-page.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-framework-react/src/runtime/connect-native.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
🧬 Code Graph Analysis (3)
packages/taro-runtime/src/dsl/common.ts (2)
packages/taro-runtime/src/bom/window.ts (1)
taroWindowProvider
(112-112)packages/taro-runtime/src/index.ts (1)
taroWindowProvider
(17-17)
packages/taro-platform-harmony/src/runtime-framework/react/native-page.ts (2)
packages/taro-platform-harmony/src/runtime-ets/bom/window.ts (1)
window
(48-48)packages/taro-framework-react/src/runtime/react-meta.ts (1)
reactMeta
(10-13)
packages/taro-framework-react/src/runtime/connect-native.ts (2)
packages/taro-framework-react/src/runtime/react-meta.ts (1)
reactMeta
(10-13)packages/taro-framework-react/src/runtime/connect.ts (1)
setReconciler
(21-94)
🪛 Biome (1.9.4)
packages/taroize/src/wxml.ts
[error] 455-456: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
- GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
- GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
- GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
🔇 Additional comments (16)
packages/shared/src/shortcuts.ts (1)
9-9
: 注释拼写修正已生效 👍注释由 “Attrtibutes” 更正为 “Attributes”,提高了可读性,无功能影响。
packages/taro-runtime/src/constants/index.ts (1)
60-60
: 拼写修正正确!将枚举成员
DESTORY
修正为DESTROY
是正确的拼写更正,保持了相同的值'3'
。packages/taro-runtime/src/bom/location.ts (1)
86-86
: 常量使用更新正确!正确使用了修正后的
CONTEXT_ACTIONS.DESTROY
常量,事件监听器注册逻辑保持不变。packages/taro-runtime/src/bom/history.ts (1)
77-77
: 常量使用更新正确!正确使用了修正后的
CONTEXT_ACTIONS.DESTROY
常量,缓存清理逻辑保持不变。packages/taro-runtime/src/__tests__/location.spec.js (1)
373-373
: 测试注释更新正确!测试用例中的注释正确更新为
CONTEXT_ACTIONS.DESTROY
,与代码实现保持一致。Also applies to: 471-471
packages/taro-runtime/src/bom/window.ts (1)
79-82
: 常量使用更新正确!所有三处都正确使用了修正后的
CONTEXT_ACTIONS.DESTROY
常量,页面卸载时的上下文清理逻辑保持不变。packages/taro-platform-harmony/src/runtime-framework/solid/page.ts (1)
155-155
: 拼写错误修正正确将
CONTEXT_ACTIONS.DESTORY
修正为CONTEXT_ACTIONS.DESTROY
是必要的拼写错误修复,确保了上下文销毁事件名称的正确性。packages/taro-platform-harmony/src/runtime-framework/react/page.ts (1)
155-155
: 拼写错误修正正确与其他平台文件保持一致,将
CONTEXT_ACTIONS.DESTORY
修正为CONTEXT_ACTIONS.DESTROY
,确保了跨平台代码的命名一致性。packages/taro-platform-harmony-cpp/src/runtime/framework/page.ts (1)
157-157
: 拼写错误修正正确在 harmony-cpp 平台中同样修正了
CONTEXT_ACTIONS.DESTORY
为CONTEXT_ACTIONS.DESTROY
,完善了整个代码库中事件命名的一致性。packages/taro-router/README.md (2)
7-7
: 参数命名规范修正正确将
reactdom
修正为reactDOM
符合 JavaScript 的 camelCase 命名规范,提升了 API 文档的专业性。
29-29
: 参数说明命名规范修正正确与函数签名保持一致,将参数说明中的
reactdom
修正为reactDOM
,确保了文档的一致性。packages/taro-runtime/src/dsl/common.ts (1)
175-175
: 核心运行时文件拼写错误修正正确在运行时核心文件中将
CONTEXT_ACTIONS.DESTORY
修正为CONTEXT_ACTIONS.DESTROY
,与其他平台文件保持一致,完善了整个代码库的拼写错误修复。packages/taro-platform-harmony/src/runtime-framework/react/native-page.ts (1)
320-324
: 事件常量已纠正,但请确认所有订阅方也已同步修改
window.trigger(CONTEXT_ACTIONS.DESTROY, $taroPath)
的拼写修复消除了潜在的事件对不上号问题 👍。
建议 grep 全仓库,确认没有遗漏的DESTORY
监听或触发代码,以避免运行期出现「事件未触发」的隐性 Bug。packages/taro-platform-harmony-cpp/src/runtime/framework/native-page.ts (1)
328-332
: DESTROY 常量修复 👍卸载时改为
CONTEXT_ACTIONS.DESTROY
与常量定义保持一致,逻辑正确。packages/taro-framework-react/src/runtime/connect-native.ts (1)
244-249
: 拼写修正已到位,但请排查遗留代码
CONTEXT_ACTIONS.DESTROY
已替换成功。推荐执行一次:rg DESTORY packages | wc -l
确认仓库中不再存在旧拼写。
packages/taroize/src/template.ts (1)
17-18
: 同步修正 import 与调用,依赖关系已恢复
template.ts
中的 import 与path.traverse
调用已同步使用新函数名,编译时不会再出现找不到符号的问题。Also applies to: 213-214
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17928 +/- ##
==========================================
+ Coverage 54.98% 55.52% +0.53%
==========================================
Files 417 442 +25
Lines 21693 23323 +1630
Branches 5359 5788 +429
==========================================
+ Hits 11928 12949 +1021
- Misses 8120 8497 +377
- Partials 1645 1877 +232
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/taro-runtime/src/__tests__/window.spec.js
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
packages/taro-runtime/src/__tests__/window.spec.js (5)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
Learnt from: Single-Dancer
PR: NervJS/taro#17653
File: packages/taro-components-advanced/src/components/water-flow/node.ts:83-95
Timestamp: 2025-05-06T06:55:44.077Z
Learning: 在 Taro 的 getRectSizeSync 函数中,如果找不到指定的节点,函数会一直处于 pending 状态而不是抛出错误。在这种情况下,使用 try/catch 处理不够充分,需要添加超时处理如 Promise.race 来避免无限等待。
Learnt from: Single-Dancer
PR: NervJS/taro#17653
File: packages/taro-components-advanced/src/components/water-flow/node.ts:83-95
Timestamp: 2025-05-06T06:55:44.077Z
Learning: 在 Taro 的 water-flow 组件中,getRectSizeSync 函数如果找不到指定的节点,会一直处于 pending 状态而不是抛出错误。在这种情况下,应该使用 Promise.race 添加超时机制,而不是仅依赖 try/catch 来处理错误。
Learnt from: Single-Dancer
PR: NervJS/taro#17653
File: packages/taro-components-advanced/src/components/water-flow/node.ts:83-95
Timestamp: 2025-05-06T06:55:44.077Z
Learning: 在 Taro 的 water-flow 组件中,getRectSizeSync 函数如果找不到指定的节点并且重试次数用尽,会一直处于 pending 状态而不是抛出错误,因为它在 retryTimes <= 0 时直接返回而不 resolve 或 reject Promise。应该使用 Promise.race 添加超时机制来解决这个问题。
🧬 Code Graph Analysis (1)
packages/taro-runtime/src/__tests__/window.spec.js (2)
packages/taro-runtime/src/bom/window.ts (1)
document
(86-88)packages/taro-extend/src/jquery/sizzle.js (1)
doc
(587-587)
🪛 Biome (1.9.4)
packages/taro-runtime/src/__tests__/window.spec.js
[error] 458-458: A global variable should not be reassigned.
Assigning to a global variable can override essential functionality.
(lint/suspicious/noGlobalAssign)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
- GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
- GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
- GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
- GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (2)
packages/taro-runtime/src/__tests__/window.spec.js (2)
3-728
: 优秀的测试覆盖率和结构这个测试套件为 Taro 运行时的 window 对象提供了全面且结构良好的测试覆盖。测试正确使用了修正后的
CONTEXT_ACTIONS.DESTROY
常量,涵盖了属性验证、事件处理、上下文操作、定时器和边界情况等各个方面。
289-290
: 合理处理测试环境差异在处理
setTimeout
和requestAnimationFrame
等 API 时,代码通过注释说明了测试环境与浏览器环境的差异,这是一个thoughtful的处理方式。这些注释掉的断言为未来可能的测试环境改进保留了参考。Also applies to: 302-303, 404-406
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.
Actionable comments posted: 2
🧹 Nitpick comments (10)
packages/taro-runtime/tests/exports.spec.ts (1)
5-5
: 修正测试套件命名不一致问题测试套件名称 "style" 与实际测试内容不符。该测试主要验证运行时模块的各种导出(BOM、DOM、事件、DSL),而不是样式相关功能。
建议修改为更准确的名称:
-describe('style', () => { +describe('exports', () => {packages/taro-runtime/tests/class.spec.ts (1)
10-10
: 建议移除注释掉的代码注释掉的
global.navigator = runtime.navigator
代码如果不需要,建议直接删除以保持代码整洁。- // global.navigator = runtime.navigator
packages/taro-runtime/tests/style.spec.ts (2)
15-15
: 建议改进测试用例的命名测试用例名称"works"过于通用,建议使用更具描述性的名称,例如"should handle style property operations correctly"。
- it('works', () => { + it('should handle style property operations correctly', () => {
19-19
: 建议添加注释说明内部属性的使用测试中使用了
_usedStyleProp
这个内部属性,建议添加注释说明为什么需要测试这个内部状态。+ // 验证内部属性追踪机制 expect(style._usedStyleProp.size).toBe(1)
packages/taro-runtime/tests/eventSource.spec.ts (1)
65-65
: 建议验证硬编码的数字测试中使用了硬编码的数字10和3,建议添加注释说明这些数字的来源,或者使用更明确的计算方式。
+ // 总共创建了10个节点:1个container + 1个list + 4个list的子节点 + 4个嵌套节点 expect(eventSource.size).toBe(10)
packages/taro-runtime/tests/dsl-common.spec.ts (1)
88-110
: ID生成器测试与其他文件重复这个测试与
utils-functions.spec.ts
中的ID生成器测试有重复。建议将ID生成器的测试统一到一个文件中,避免重复。考虑将ID生成器测试移到
utils-functions.spec.ts
中,因为它是一个工具函数。packages/taro-runtime/tests/bom.spec.ts (1)
65-108
: 建议增强 BOM 模块测试的深度当前的 Navigator、getComputedStyle 和 Document 模块测试过于基础,仅检查模块是否存在。建议添加功能性测试来验证这些模块的实际行为。
例如,可以添加如下测试:
describe('BOM - Navigator', () => { it('should provide navigator-like functionality', async () => { const navigatorModule = await import('../src/bom/navigator') expect(navigatorModule).toBeDefined() - expect(Object.keys(navigatorModule).length).toBeGreaterThanOrEqual(0) + // 测试具体的 navigator 属性和方法 + expect(navigatorModule.userAgent).toBeDefined() + expect(typeof navigatorModule.platform).toBe('string') }) })packages/taro-runtime/tests/html.spec.ts (1)
14-20
: 建议完成或移除跳过的测试当前有一个被跳过的测试,注释说"测试还没写完"。建议要么完成这个测试,要么如果不需要就移除它,以保持测试套件的完整性。
是否需要我帮助实现这个测试或者建议如何完成它?
packages/taro-runtime/tests/dom.spec.ts (2)
17-17
: 修正测试描述中的拼写错误测试描述中的 "childeNodes" 应该是 "childNodes"。
- it('childeNodes 有任何类型', () => { + it('childNodes 有任何类型', () => {
160-160
: 修正测试描述中的拼写错误测试描述中的 "textContext" 应该是 "textContent"。
- it('textContext', () => { + it('textContent', () => {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
packages/taroize/__tests__/__snapshots__/wxml.test.ts.snap
is excluded by!**/*.snap
📒 Files selected for processing (22)
packages/taro-runtime/package.json
(1 hunks)packages/taro-runtime/src/bom/window.ts
(1 hunks)packages/taro-runtime/src/polyfill/array.ts
(1 hunks)packages/taro-runtime/tests/bom.spec.ts
(1 hunks)packages/taro-runtime/tests/cache.spec.ts
(1 hunks)packages/taro-runtime/tests/class.spec.ts
(1 hunks)packages/taro-runtime/tests/dom-style.spec.ts
(1 hunks)packages/taro-runtime/tests/dom.spec.ts
(1 hunks)packages/taro-runtime/tests/dsl-common.spec.ts
(1 hunks)packages/taro-runtime/tests/event.spec.ts
(1 hunks)packages/taro-runtime/tests/eventSource.spec.ts
(1 hunks)packages/taro-runtime/tests/exports.spec.ts
(1 hunks)packages/taro-runtime/tests/html.spec.ts
(1 hunks)packages/taro-runtime/tests/location.spec.ts
(1 hunks)packages/taro-runtime/tests/mutation.spec.ts
(1 hunks)packages/taro-runtime/tests/polyfill-array.spec.ts
(1 hunks)packages/taro-runtime/tests/react.spec.ts
(1 hunks)packages/taro-runtime/tests/setup.ts
(1 hunks)packages/taro-runtime/tests/style.spec.ts
(1 hunks)packages/taro-runtime/tests/utils-functions.spec.ts
(1 hunks)packages/taro-runtime/tests/utils.ts
(1 hunks)packages/taro-runtime/vitest.config.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (5)
- packages/taro-runtime/tests/utils.ts
- packages/taro-runtime/package.json
- packages/taro-runtime/src/bom/window.ts
- packages/taro-runtime/tests/setup.ts
- packages/taro-runtime/vitest.config.ts
🧰 Additional context used
🧠 Learnings (16)
📓 Common learnings
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: Single-Dancer
PR: NervJS/taro#17653
File: packages/taro-components-advanced/src/components/water-flow/node.ts:83-95
Timestamp: 2025-05-06T06:55:44.077Z
Learning: 在 Taro 的 getRectSizeSync 函数中,如果找不到指定的节点,函数会一直处于 pending 状态而不是抛出错误。在这种情况下,使用 try/catch 处理不够充分,需要添加超时处理如 Promise.race 来避免无限等待。
packages/taro-runtime/tests/react.spec.ts (2)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-runtime/tests/cache.spec.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-runtime/tests/exports.spec.ts (2)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-runtime/tests/eventSource.spec.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-runtime/tests/polyfill-array.spec.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-runtime/tests/utils-functions.spec.ts (2)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-runtime/tests/class.spec.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-runtime/tests/html.spec.ts (2)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-runtime/tests/event.spec.ts (2)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-runtime/tests/dsl-common.spec.ts (2)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-runtime/tests/bom.spec.ts (2)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-runtime/tests/dom.spec.ts (2)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-runtime/tests/dom-style.spec.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-runtime/tests/mutation.spec.ts (2)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-runtime/tests/location.spec.ts (1)
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
🧬 Code Graph Analysis (7)
packages/taro-runtime/tests/react.spec.ts (1)
packages/taro-runtime/src/bom/window.ts (1)
document
(86-88)
packages/taro-runtime/tests/eventSource.spec.ts (2)
packages/taro-runtime/src/bom/window.ts (1)
document
(86-88)packages/taro-runtime/src/dom/event.ts (1)
target
(65-88)
packages/taro-runtime/tests/utils-functions.spec.ts (2)
packages/taro-runtime/src/index.ts (1)
TaroText
(26-26)packages/taro-runtime/src/utils/index.ts (5)
isText
(61-63)isComment
(65-67)isHasExtractProp
(69-74)shortcutAttr
(93-104)customWrapperCache
(106-106)
packages/taro-runtime/tests/style.spec.ts (2)
packages/taro-runtime/src/bom/window.ts (1)
document
(86-88)packages/taro-platform-harmony/src/runtime-ets/dom/element/element.ts (1)
style
(254-256)
packages/taro-runtime/tests/bom.spec.ts (2)
packages/taro-runtime/src/bom/window.ts (3)
setTimeout
(100-102)clearTimeout
(104-106)taroWindowProvider
(112-112)packages/taro-runtime/src/index.ts (2)
raf
(14-14)caf
(14-14)
packages/taro-runtime/tests/dom-style.spec.ts (2)
packages/taro-runtime/src/bom/window.ts (1)
document
(86-88)packages/taro-platform-harmony/src/runtime-ets/dom/element/element.ts (1)
style
(254-256)
packages/taro-runtime/tests/mutation.spec.ts (2)
packages/taro-runtime/src/bom/window.ts (1)
document
(86-88)packages/taro-runtime/src/index.ts (1)
MutationObserver
(27-27)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
- GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
- GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
- GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
- GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (28)
packages/taro-runtime/src/polyfill/array.ts (1)
56-81
: 新增的 findIndex polyfill 实现正确这个新增的
handleArrayFindIndexPolyfill
函数完全遵循了 ECMAScript 规范,实现方式与现有的find
和includes
polyfill 保持一致。函数正确处理了this
上下文验证、类型检查、以及thisArg
参数传递。packages/taro-runtime/tests/react.spec.ts (1)
1-21
: React 集成测试实现良好测试文件结构合理,正确设置了 React 框架环境变量,并在测试后进行了清理。事件处理测试覆盖了 React 集成的核心功能,验证了 tap 事件的分发和监听器调用。
packages/taro-runtime/tests/polyfill-array.spec.ts (1)
1-131
: Array polyfill 测试覆盖全面且结构良好测试文件展现了优秀的测试实践:
- 使用 beforeEach/afterEach 正确保存和恢复原生方法,确保测试隔离
- 动态导入 polyfill 函数避免了副作用
- 全面测试了 includes、find、findIndex 三个 polyfill 的功能
- 覆盖了边界情况,包括 null、undefined、0、false、空字符串等特殊值
- 验证了回调函数的参数传递(value、index、array)
packages/taro-runtime/tests/exports.spec.ts (1)
10-33
: 导出验证测试实现正确测试全面验证了运行时模块的关键导出,包括 BOM 对象、DOM 类、事件系统和 DSL 配置功能。测试逻辑正确,覆盖了模块的主要 API 接口。
packages/taro-runtime/tests/cache.spec.ts (1)
1-94
: 缓存工具测试覆盖全面且实现优秀测试文件展现了出色的测试设计:
- 全面测试了 RuntimeCache 的核心功能:set、get、has、delete
- 测试了各种数据类型,包括字符串、数字、复杂对象和嵌套结构
- 正确处理边界情况,如空值、null、undefined 的过滤逻辑
- 验证了多个缓存实例的独立性
- 使用 beforeEach 确保每个测试都有干净的缓存实例
测试逻辑清晰,覆盖了缓存工具的所有关键场景。
packages/taro-runtime/tests/class.spec.ts (2)
1-109
: 测试文件结构良好,覆盖了核心功能这个测试文件很好地覆盖了DOM元素的class属性和classList API的核心功能。测试逻辑清晰,包含了主要的使用场景。
57-58
: 测试用例可以更简洁这个测试用例验证了classList.add()的幂等性(添加相同class不会重复),逻辑正确。
packages/taro-runtime/tests/style.spec.ts (1)
1-43
: 测试文件整体结构良好这个测试文件有效地验证了Style类的核心功能,包括属性设置、获取、删除和cssText操作。测试逻辑正确,覆盖了主要的使用场景。
packages/taro-runtime/tests/eventSource.spec.ts (2)
1-76
: 测试文件结构良好,覆盖了核心功能这个测试文件很好地验证了eventSource模块的节点删除功能,包括单个节点删除和整个节点树删除。测试逻辑清晰,使用了适当的生命周期钩子。
26-51
: 测试用例的文档注释很有帮助使用HTML注释来描述DOM结构是一个很好的做法,让测试用例更容易理解。
packages/taro-runtime/tests/utils-functions.spec.ts (2)
1-209
: 测试文件组织良好,覆盖面广这个测试文件很好地组织了各种工具函数的测试,包含了节点类型检查、属性工具、组件工具等多个方面。测试逻辑清晰,覆盖了边界情况。
185-187
: ID生成器测试验证了正确的序列测试正确地验证了ID生成器的序列性,从'AA'开始递增。这个测试逻辑是正确的。
packages/taro-runtime/tests/dsl-common.spec.ts (2)
1-112
: 测试文件结构良好,覆盖了主要功能这个测试文件很好地验证了DSL通用功能,包括页面实例管理、安全执行、组件配置等。测试逻辑清晰,覆盖了主要的使用场景。
60-64
: 测试用例验证了错误处理测试正确地验证了
safeExecute
函数在处理不存在的页面实例时的行为,返回undefined是合理的。packages/taro-runtime/tests/bom.spec.ts (1)
12-63
: RAF 测试实现得很好RequestAnimationFrame 测试使用了正确的模拟和清理模式,包括:
- 在 beforeEach/afterEach 中正确设置和恢复全局函数
- 60fps 的合理模拟实现
- 异步测试模式的正确使用
packages/taro-runtime/tests/dom-style.spec.ts (1)
1-101
: 样式类测试覆盖全面且实现良好这个测试套件很好地覆盖了 Style 类的各个方面:
- 初始化状态验证
- 属性设置和获取
- CSS 变量处理
- cssText 的 getter/setter
- removeProperty 方法
- 边缘情况处理(空值、不存在的属性)
测试结构清晰,使用了合适的 beforeEach 设置,并且涵盖了重要的边缘情况。
packages/taro-runtime/tests/event.spec.ts (1)
1-185
: 事件处理测试非常全面这个测试套件很好地覆盖了事件系统的各个方面:
- addEventListener 和 removeEventListener 的基本功能
- 事件选项(如
{ once: true }
)的正确处理- 事件名称的小写化规范化
- 事件传播控制(stopPropagation、preventDefault、stopImmediatePropagation)
- 多个事件处理器的管理
- 边缘情况处理(空事件移除、无监听器的事件分发)
测试使用了适当的 spy 函数和异步模式,代码质量很高。
packages/taro-runtime/tests/html.spec.ts (1)
22-391
: HTML 解析和 CSS 选择器测试非常全面这个测试套件对 HTML 解析和 CSS 功能的测试覆盖非常全面:
- 各种 CSS 选择器(标签、ID、类、属性选择器)
- CSS 组合器(后代、子元素、相邻兄弟、通用兄弟)
- CSS 特异性和排序
- 特殊标签处理(如 script 标签的跳过)
- 自定义文本转换功能
测试用例设计得很好,覆盖了复杂的选择器组合和边缘情况。
packages/taro-runtime/tests/mutation.spec.ts (1)
1-284
: MutationObserver 测试实现优秀这个测试套件对 MutationObserver 功能进行了全面而精确的测试:
- 覆盖了所有主要的 DOM 变更操作(appendChild、replaceChild、removeChild)
- 正确验证了变更记录的结构(target、type、previousSibling、nextSibling、addedNodes、removedNodes)
- 包含了子树观察(subtree)的测试
- 使用了正确的异步测试模式
- 测试组织清晰,包含适当的设置和清理
测试覆盖了各种场景,包括单节点、多节点和深层树结构的变更,确保 MutationObserver 的行为符合预期。
packages/taro-runtime/tests/dom.spec.ts (3)
5-14
: 测试环境设置合理正确设置了 Vitest 测试环境,包括 FRAMEWORK 环境变量和全局对象的配置,afterAll 清理也很到位。
127-149
: insertAdjacentHTML 测试覆盖全面测试覆盖了 insertAdjacentHTML 的所有四个位置选项(beforebegin, afterbegin, beforeend, afterend),验证逻辑正确且全面。
261-310
: 锚点元素 URL 解析测试详尽全面测试了锚点元素的 URL 解析功能,包括各种 URL 组件(protocol, host, pathname, search, hash 等),测试用例覆盖了不同的 URL 格式。
packages/taro-runtime/tests/location.spec.ts (6)
6-53
: parseUrl 函数测试覆盖全面测试用例涵盖了完整 URL、不完整 URL、边界情况等多种场景,包括协议默认处理和路径规范化,测试逻辑正确。
116-146
: URL 构造函数错误处理测试完整正确测试了各种无效 URL 构造的错误情况,包括空参数、无效协议、无效基础 URL 等,错误类型和消息验证准确。
164-186
: URL 构造测试用例来源权威测试用例参考了 MDN 官方文档,确保了实现与标准的一致性,这是很好的做法。
338-347
: 事件触发和模拟处理正确使用
vi.fn()
正确模拟了 window.trigger 方法,并验证了 hashchange 事件的触发次数,测试逻辑清晰。
349-378
: 上下文操作测试覆盖完整全面测试了 CONTEXT_ACTIONS 的各种操作(INIT, RESTORE, RECOVER, DESTROY),包括缓存管理和状态恢复,验证了复杂的生命周期管理逻辑。
442-476
: History 上下文操作测试详尽History 对象的上下文操作测试与 Location 类似但更复杂,正确验证了历史记录长度、缓存状态和位置恢复,测试设计合理。
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (8)
package.json
(2 hunks)packages/taro-runtime/jest.config.js
(0 hunks)packages/taro-runtime/src/__tests__/mutation.spec.js
(0 hunks)packages/taro-runtime/src/dom/event.ts
(2 hunks)packages/taro-runtime/src/utils/index.ts
(1 hunks)packages/taro-runtime/tests/utils-functions.spec.ts
(1 hunks)packages/taro-runtime/tsconfig.json
(0 hunks)packages/taro-runtime/vitest.config.ts
(1 hunks)
💤 Files with no reviewable changes (3)
- packages/taro-runtime/tsconfig.json
- packages/taro-runtime/jest.config.js
- packages/taro-runtime/src/tests/mutation.spec.js
✅ Files skipped from review due to trivial changes (3)
- packages/taro-runtime/src/dom/event.ts
- package.json
- packages/taro-runtime/src/utils/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/taro-runtime/tests/utils-functions.spec.ts
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-runtime/vitest.config.ts (2)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
- GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
- GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
- GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
- GitHub Check: Build Rust WASM / stable - wasm32-wasi
这个 PR 是什么类型? (至少选择一个)
Summary by CodeRabbit
新特性
修复
重构
文档
依赖升级
样式