Skip to content

getCombinedMeta(metaBase: SCMetadata, metaCustom: SCMetadata)#690

Merged
CodFrm merged 1 commit intoscriptscat:mainfrom
cyfung1031:h
Aug 29, 2025
Merged

getCombinedMeta(metaBase: SCMetadata, metaCustom: SCMetadata)#690
CodFrm merged 1 commit intoscriptscat:mainfrom
cyfung1031:h

Conversation

@cyfung1031
Copy link
Copy Markdown
Collaborator

@cyfung1031 cyfung1031 commented Aug 28, 2025

beta 分支的單元測試也要同樣更新

@CodFrm
Copy link
Copy Markdown
Member

CodFrm commented Aug 28, 2025

?: 的话,就不用判断 selfMetadata 是不是 undefined了

@CodFrm CodFrm changed the base branch from main to release/beta August 29, 2025 02:28
@CodFrm CodFrm changed the base branch from release/beta to main August 29, 2025 02:28
@CodFrm CodFrm merged commit 1ccf53f into scriptscat:main Aug 29, 2025
2 of 3 checks passed
@CodFrm
Copy link
Copy Markdown
Member

CodFrm commented Aug 29, 2025

如果beta分支要改的话,应该是从beta分支上去修改,然后再合并到main

CodFrm pushed a commit that referenced this pull request Aug 29, 2025
@cyfung1031
Copy link
Copy Markdown
Collaborator Author

?: 的话,就不用判断 selfMetadata 是不是 undefined了

代码是可以这样。TypeScript是不会报错。但逻辑上有错

以前你讲过类似不要为了单元测试而改动本来的代码之类 (当时我打算搞一个为了单元测试而做的函数)

这个 getCombinedMeta 是要两个 meta 合在一起
所以道理上不会有 getCombinedMeta(meta) 这个用法
因此,做单元测试时,我们应该避免这样的改动。
否则去理解实际的代码时,会无法理解为什么第二个参数可以不提供

@cyfung1031 cyfung1031 deleted the h branch October 4, 2025 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants