Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uvue
提交
a80e5ae8
H
hello-uvue
项目概览
DCloud
/
hello-uvue
通知
349
Star
2
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello-uvue
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a80e5ae8
编写于
1月 25, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: 优化测试例
上级
d889babf
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
9 deletion
+9
-9
pages/composition-api/basic/define-props/define-props.test.js
...s/composition-api/basic/define-props/define-props.test.js
+8
-8
pages/composition-api/basic/use-slots/use-slots.test.js
pages/composition-api/basic/use-slots/use-slots.test.js
+1
-1
未找到文件。
pages/composition-api/basic/define-props/define-props.test.js
浏览文件 @
a80e5ae8
...
...
@@ -13,15 +13,15 @@ describe('defineProps', () => {
expect
(
await
arrayLiteralNum
.
text
()).
toBe
(
'
num: 0
'
)
const
arrayLiteralBool
=
await
page
.
$
(
'
#array-literal-bool
'
)
expect
(
await
arrayLiteralBool
.
text
()).
toBe
(
'
bool: false
'
)
const
arrayLiteralArr
=
await
page
.
$
(
'
#array-literal-arr
'
)
expect
(
(
await
arrayLiteralArr
.
text
()).
replaceAll
(
'
\n
'
,
''
)).
toBe
(
'
arr: ["a","b","c"]
'
)
const
arrayLiteralArr
=
await
page
.
$
(
'
#array-literal-arr
'
)
expect
(
await
arrayLiteralArr
.
text
()).
toBe
(
'
arr: ["a","b","c"]
'
)
const
arrayLiteralObj
=
await
page
.
$
(
'
#array-literal-obj
'
)
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
expect
(
await
arrayLiteralObj
.
text
()).
toBe
(
'
obj: {"arr":[1,2,3],"num":0,"str":"obj str"}
'
)
}
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
))
{
expect
(
(
await
arrayLiteralObj
.
text
()).
replaceAll
(
'
\n
'
,
''
)).
toBe
(
expect
(
await
arrayLiteralObj
.
text
(
)).
toBe
(
'
obj: {"str": "obj str","num": 0,"arr": [1,2,3]}
'
)
}
...
...
@@ -35,15 +35,15 @@ describe('defineProps', () => {
const
objectLiteralBool
=
await
page
.
$
(
'
#object-literal-bool
'
)
expect
(
await
objectLiteralBool
.
text
()).
toBe
(
'
bool: false
'
)
const
objectLiteralArr
=
await
page
.
$
(
'
#object-literal-arr
'
)
expect
(
(
await
objectLiteralArr
.
text
()).
replaceAll
(
'
\n
'
,
''
)).
toBe
(
'
arr: ["a","b","c"]
'
)
expect
(
await
objectLiteralArr
.
text
()).
toBe
(
'
arr: ["a","b","c"]
'
)
const
objectLiteralObj
=
await
page
.
$
(
'
#object-literal-obj
'
)
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
expect
(
await
objectLiteralObj
.
text
()).
toBe
(
'
obj: {"a":1}
'
)
}
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
))
{
expect
(
(
await
objectLiteralObj
.
text
()).
replaceAll
(
'
\n
'
,
''
)).
toBe
(
'
obj: {"a": 1}
'
)
}
expect
(
await
objectLiteralObj
.
text
(
)).
toBe
(
'
obj: {"a": 1}
'
)
}
const
objectLiteralFn
=
await
page
.
$
(
'
#object-literal-fn
'
)
expect
(
await
objectLiteralFn
.
text
()).
toBe
(
'
fn: fn res
'
)
...
...
@@ -55,14 +55,14 @@ describe('defineProps', () => {
const
typeBool
=
await
page
.
$
(
'
#type-bool
'
)
expect
(
await
typeBool
.
text
()).
toBe
(
'
bool: false
'
)
const
typeArr
=
await
page
.
$
(
'
#type-arr
'
)
expect
(
(
await
typeArr
.
text
()).
replaceAll
(
'
\n
'
,
''
)).
toBe
(
'
arr: ["a","b","c"]
'
)
expect
(
await
typeArr
.
text
()).
toBe
(
'
arr: ["a","b","c"]
'
)
const
typeObj
=
await
page
.
$
(
'
#type-obj
'
)
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
android
'
))
{
expect
(
await
typeObj
.
text
()).
toBe
(
'
obj: {"arr":[1,2,3],"num":0,"str":"obj str"}
'
)
}
if
(
process
.
env
.
uniTestPlatformInfo
.
startsWith
(
'
web
'
))
{
expect
(
(
await
typeObj
.
text
()).
replaceAll
(
'
\n
'
,
''
)).
toBe
(
'
obj: {"str": "obj str","num": 0,"arr": [1,2,3]}
'
)
expect
(
await
typeObj
.
text
(
)).
toBe
(
'
obj: {"str": "obj str","num": 0,"arr": [1,2,3]}
'
)
}
const
typeFn
=
await
page
.
$
(
'
#type-fn
'
)
...
...
pages/composition-api/basic/use-slots/use-slots.test.js
浏览文件 @
a80e5ae8
...
...
@@ -14,7 +14,7 @@ describe('useSlots', () => {
expect
(
await
slotContent
.
text
()).
toBe
(
'
default slot msg: default msg
'
)
const
slotFooter
=
await
page
.
$
(
'
#slot-footer
'
)
expect
(
(
await
slotFooter
.
text
()).
replaceAll
(
'
\n
'
,
''
)).
toBe
(
'
footer slot arr: ["a","b","c"]
'
)
expect
(
await
slotFooter
.
text
(
)).
toBe
(
'
footer slot arr: ["a","b","c"]
'
)
const
checkUseSlotsRes
=
await
page
.
$
(
'
#check-use-slots-res
'
)
expect
(
await
checkUseSlotsRes
.
text
()).
toBe
(
'
check useSlots result: false
'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录