Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
bit-pm
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
燕伟桐
bit-pm
Commits
f093a659
提交
f093a659
authored
4月 14, 2025
作者:
Will Chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix chat stream handlers test
上级
501f35a7
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
10 行删除
+10
-10
chat_stream_handlers.test.ts
src/__tests__/chat_stream_handlers.test.ts
+10
-10
没有找到文件。
src/__tests__/chat_stream_handlers.test.ts
浏览文件 @
f093a659
...
...
@@ -396,8 +396,8 @@ describe("getDyadRenameTags", () => {
it
(
"should return an array of dyad-rename tags"
,
()
=>
{
const
result
=
getDyadRenameTags
(
`<dyad-rename from="src/components/UserProfile.jsx" to="src/components/ProfileCard.jsx"
/
>
<dyad-rename from="src/utils/helpers.js" to="src/utils/utils.js"
/
>`
`<dyad-rename from="src/components/UserProfile.jsx" to="src/components/ProfileCard.jsx"
></dyad-rename
>
<dyad-rename from="src/utils/helpers.js" to="src/utils/utils.js"
></dyad-rename
>`
);
expect
(
result
).
toEqual
([
{
...
...
@@ -417,8 +417,8 @@ describe("getDyadDeleteTags", () => {
it
(
"should return an array of dyad-delete paths"
,
()
=>
{
const
result
=
getDyadDeleteTags
(
`<dyad-delete path="src/components/Analytics.jsx"
/
>
<dyad-delete path="src/utils/unused.js"
/
>`
`<dyad-delete path="src/components/Analytics.jsx"
></dyad-delete
>
<dyad-delete path="src/utils/unused.js"
></dyad-delete
>`
);
expect
(
result
).
toEqual
([
"src/components/Analytics.jsx"
,
...
...
@@ -588,7 +588,7 @@ describe("processFullResponse", () => {
vi
.
mocked
(
fs
.
mkdirSync
).
mockImplementation
(()
=>
undefined
);
vi
.
mocked
(
fs
.
renameSync
).
mockImplementation
(()
=>
undefined
);
const
response
=
`<dyad-rename from="src/components/OldComponent.jsx" to="src/components/NewComponent.jsx"
/
>`
;
const
response
=
`<dyad-rename from="src/components/OldComponent.jsx" to="src/components/NewComponent.jsx"
></dyad-rename
>`
;
const
result
=
await
processFullResponseActions
(
response
,
1
,
{
chatSummary
:
undefined
,
...
...
@@ -620,7 +620,7 @@ describe("processFullResponse", () => {
// Set up the mock to return false for existsSync
vi
.
mocked
(
fs
.
existsSync
).
mockReturnValue
(
false
);
const
response
=
`<dyad-rename from="src/components/NonExistent.jsx" to="src/components/NewFile.jsx"
/
>`
;
const
response
=
`<dyad-rename from="src/components/NonExistent.jsx" to="src/components/NewFile.jsx"
></dyad-rename
>`
;
const
result
=
await
processFullResponseActions
(
response
,
1
,
{
chatSummary
:
undefined
,
...
...
@@ -637,7 +637,7 @@ describe("processFullResponse", () => {
vi
.
mocked
(
fs
.
existsSync
).
mockReturnValue
(
true
);
vi
.
mocked
(
fs
.
unlinkSync
).
mockImplementation
(()
=>
undefined
);
const
response
=
`<dyad-delete path="src/components/Unused.jsx"
/
>`
;
const
response
=
`<dyad-delete path="src/components/Unused.jsx"
></dyad-delete
>`
;
const
result
=
await
processFullResponseActions
(
response
,
1
,
{
chatSummary
:
undefined
,
...
...
@@ -659,7 +659,7 @@ describe("processFullResponse", () => {
// Set up the mock to return false for existsSync
vi
.
mocked
(
fs
.
existsSync
).
mockReturnValue
(
false
);
const
response
=
`<dyad-delete path="src/components/NonExistent.jsx"
/
>`
;
const
response
=
`<dyad-delete path="src/components/NonExistent.jsx"
></dyad-delete
>`
;
const
result
=
await
processFullResponseActions
(
response
,
1
,
{
chatSummary
:
undefined
,
...
...
@@ -681,8 +681,8 @@ describe("processFullResponse", () => {
const
response
=
`
<dyad-write path="src/components/NewComponent.jsx">import React from 'react'; export default () => <div>New</div>;</dyad-write>
<dyad-rename from="src/components/OldComponent.jsx" to="src/components/RenamedComponent.jsx"
/
>
<dyad-delete path="src/components/Unused.jsx"
/
>
<dyad-rename from="src/components/OldComponent.jsx" to="src/components/RenamedComponent.jsx"
></dyad-rename
>
<dyad-delete path="src/components/Unused.jsx"
></dyad-delete
>
`
;
const
result
=
await
processFullResponseActions
(
response
,
1
,
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论