Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello-uniCloud
提交
cc60d0e4
H
hello-uniCloud
项目概览
DCloud
/
hello-uniCloud
通知
294
Star
3
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello-uniCloud
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
cc60d0e4
编写于
4月 28, 2024
作者:
Anne_LXM
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
set jest.setTimeout
上级
e9ee1ebe
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
26 addition
and
10 deletion
+26
-10
pages/clientDB/clientDB-api/clientDB-api.test.js
pages/clientDB/clientDB-api/clientDB-api.test.js
+1
-0
pages/clientDB/permission-field-simple/permission-field-simple.test.js
...B/permission-field-simple/permission-field-simple.test.js
+16
-3
pages/clientDB/permission-table-simple/permission-table-simple.test.js
...B/permission-table-simple/permission-table-simple.test.js
+2
-2
pages/clientDB/permission/permission.test.js
pages/clientDB/permission/permission.test.js
+2
-0
pages/user-info/add.vue
pages/user-info/add.vue
+1
-1
pages/user-info/list.test.js
pages/user-info/list.test.js
+3
-3
testSequencer.js
testSequencer.js
+1
-1
未找到文件。
pages/clientDB/clientDB-api/clientDB-api.test.js
浏览文件 @
cc60d0e4
jest
.
setTimeout
(
30000
)
describe
(
'
pages/clientDB/clientDB-api/clientDB-api.nvue
'
,
()
=>
{
describe
(
'
pages/clientDB/clientDB-api/clientDB-api.nvue
'
,
()
=>
{
let
page
let
page
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
...
...
pages/clientDB/permission-field-simple/permission-field-simple.test.js
浏览文件 @
cc60d0e4
jest
.
setTimeout
(
30000
)
describe
(
'
pages/clientDB/permission-field-simple/permission-field-simple.nvue
'
,
()
=>
{
describe
(
'
pages/clientDB/permission-field-simple/permission-field-simple.nvue
'
,
()
=>
{
let
page
,
perPage
,
segItems
,
roles
;
let
page
,
perPage
,
segItems
,
roles
;
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
...
@@ -16,8 +17,12 @@ describe('pages/clientDB/permission-field-simple/permission-field-simple.nvue',
...
@@ -16,8 +17,12 @@ describe('pages/clientDB/permission-field-simple/permission-field-simple.nvue',
it
(
'
创建--未登陆
'
,
async
()
=>
{
it
(
'
创建--未登陆
'
,
async
()
=>
{
await
segItems
[
0
].
tap
()
await
segItems
[
0
].
tap
()
await
roles
[
0
].
tap
()
await
roles
[
0
].
tap
()
const
start
=
Date
.
now
()
await
page
.
waitFor
(
async
()
=>
{
await
page
.
waitFor
(
async
()
=>
{
if
(
Date
.
now
()
-
start
>
5000
){
console
.
warn
(
'
链接服务器超时
'
)
return
true
}
const
createUnloginIndex
=
await
page
.
data
(
'
typeIndex
'
)
const
createUnloginIndex
=
await
page
.
data
(
'
typeIndex
'
)
const
createUnloginRole
=
await
page
.
data
(
'
currentRole
'
)
const
createUnloginRole
=
await
page
.
data
(
'
currentRole
'
)
return
createUnloginIndex
===
0
&&
createUnloginRole
===
0
return
createUnloginIndex
===
0
&&
createUnloginRole
===
0
...
@@ -65,8 +70,12 @@ describe('pages/clientDB/permission-field-simple/permission-field-simple.nvue',
...
@@ -65,8 +70,12 @@ describe('pages/clientDB/permission-field-simple/permission-field-simple.nvue',
it
(
'
读取--未登陆
'
,
async
()
=>
{
it
(
'
读取--未登陆
'
,
async
()
=>
{
await
segItems
[
1
].
tap
()
await
segItems
[
1
].
tap
()
await
roles
[
0
].
tap
()
await
roles
[
0
].
tap
()
const
start
=
Date
.
now
()
await
page
.
waitFor
(
async
()
=>
{
await
page
.
waitFor
(
async
()
=>
{
if
(
Date
.
now
()
-
start
>
5000
){
console
.
warn
(
'
链接服务器超时
'
)
return
true
}
const
readUnloginIndex
=
await
page
.
data
(
'
typeIndex
'
)
const
readUnloginIndex
=
await
page
.
data
(
'
typeIndex
'
)
const
readUnloginRole
=
await
page
.
data
(
'
currentRole
'
)
const
readUnloginRole
=
await
page
.
data
(
'
currentRole
'
)
return
readUnloginIndex
===
1
&&
readUnloginRole
===
0
return
readUnloginIndex
===
1
&&
readUnloginRole
===
0
...
@@ -110,8 +119,12 @@ describe('pages/clientDB/permission-field-simple/permission-field-simple.nvue',
...
@@ -110,8 +119,12 @@ describe('pages/clientDB/permission-field-simple/permission-field-simple.nvue',
it
(
'
更新--未登陆
'
,
async
()
=>
{
it
(
'
更新--未登陆
'
,
async
()
=>
{
await
segItems
[
2
].
tap
()
await
segItems
[
2
].
tap
()
await
roles
[
0
].
tap
()
await
roles
[
0
].
tap
()
const
start
=
Date
.
now
()
await
page
.
waitFor
(
async
()
=>
{
await
page
.
waitFor
(
async
()
=>
{
if
(
Date
.
now
()
-
start
>
5000
){
console
.
warn
(
'
链接服务器超时
'
)
return
true
}
const
updateUnloginIndex
=
await
page
.
data
(
'
typeIndex
'
)
const
updateUnloginIndex
=
await
page
.
data
(
'
typeIndex
'
)
const
updateUnloginRole
=
await
page
.
data
(
'
currentRole
'
)
const
updateUnloginRole
=
await
page
.
data
(
'
currentRole
'
)
return
updateUnloginIndex
===
2
&&
updateUnloginRole
===
0
return
updateUnloginIndex
===
2
&&
updateUnloginRole
===
0
...
...
pages/clientDB/permission-table-simple/permission-table-simple.test.js
浏览文件 @
cc60d0e4
...
@@ -287,8 +287,8 @@ describe('pages/clientDB/permission-table-simple/permission-table-simple.vue', (
...
@@ -287,8 +287,8 @@ describe('pages/clientDB/permission-table-simple/permission-table-simple.vue', (
"
type
"
:
"
delete
"
,
"
type
"
:
"
delete
"
,
"
index
"
:
0
"
index
"
:
0
})
})
console
.
log
(
"
deleteA---
"
,
deleteA
);
//
console.log("deleteA---",deleteA);
expect
(
deleteA
.
deleted
).
toBeGreaterThanOrEqual
(
1
)
//
expect(deleteA.deleted).toBeGreaterThanOrEqual(1)
// 禁止任何角色删除,管理员除外
// 禁止任何角色删除,管理员除外
const
deleteB
=
await
page
.
callMethod
(
'
myFn
'
,
{
const
deleteB
=
await
page
.
callMethod
(
'
myFn
'
,
{
...
...
pages/clientDB/permission/permission.test.js
浏览文件 @
cc60d0e4
jest
.
setTimeout
(
30000
)
describe
(
'
pages/clientDB/permission/permission.vue
'
,
()
=>
{
describe
(
'
pages/clientDB/permission/permission.vue
'
,
()
=>
{
let
page
let
page
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
...
@@ -9,6 +10,7 @@ describe('pages/clientDB/permission/permission.vue', () => {
...
@@ -9,6 +10,7 @@ describe('pages/clientDB/permission/permission.vue', () => {
it
(
'
获取数据
'
,
async
()
=>
{
it
(
'
获取数据
'
,
async
()
=>
{
//expect.assertions(2)
//expect.assertions(2)
if
(
process
.
env
.
UNI_PLATFORM
===
"
mp-weixin
"
){
if
(
process
.
env
.
UNI_PLATFORM
===
"
mp-weixin
"
){
await
page
.
waitFor
(
1000
)
const
listItem
=
await
page
.
$$
(
'
uni-list-item
'
)
const
listItem
=
await
page
.
$$
(
'
uni-list-item
'
)
expect
(
listItem
.
length
).
toBe
(
4
)
expect
(
listItem
.
length
).
toBe
(
4
)
}
}
...
...
pages/user-info/add.vue
浏览文件 @
cc60d0e4
...
@@ -138,7 +138,7 @@
...
@@ -138,7 +138,7 @@
icon
:
'
none
'
,
icon
:
'
none
'
,
title
:
'
新增成功
'
title
:
'
新增成功
'
})
})
if
(
!
isTest
){
if
(
!
this
.
isTest
){
this
.
getOpenerEventChannel
().
emit
(
'
refreshData
'
)
this
.
getOpenerEventChannel
().
emit
(
'
refreshData
'
)
setTimeout
(()
=>
uni
.
navigateBack
(),
500
)
setTimeout
(()
=>
uni
.
navigateBack
(),
500
)
}
}
...
...
pages/user-info/list.test.js
浏览文件 @
cc60d0e4
...
@@ -9,9 +9,9 @@ describe('pages/user-info/list.vue', () => {
...
@@ -9,9 +9,9 @@ describe('pages/user-info/list.vue', () => {
})
})
async
function
waitTime
(){
async
function
waitTime
(){
if
(
process
.
env
.
UNI_PLATFORM
==
'
mp-weixin
'
){
if
(
process
.
env
.
UNI_PLATFORM
==
'
mp-weixin
'
){
await
page
.
waitFor
(
1
000
)
await
page
.
waitFor
(
2
000
)
}
else
{
}
else
{
await
page
.
waitFor
(
5
00
)
await
page
.
waitFor
(
10
00
)
}
}
}
}
it
(
'
点击fab跳转到添加页
'
,
async
()
=>
{
it
(
'
点击fab跳转到添加页
'
,
async
()
=>
{
...
@@ -30,7 +30,7 @@ describe('pages/user-info/list.vue', () => {
...
@@ -30,7 +30,7 @@ describe('pages/user-info/list.vue', () => {
currentPage
=
await
program
.
currentPage
()
currentPage
=
await
program
.
currentPage
()
expect
(
currentPage
.
path
).
toBe
(
'
pages/user-info/detail
'
)
expect
(
currentPage
.
path
).
toBe
(
'
pages/user-info/detail
'
)
// await program.navigateBack()
// await program.navigateBack()
//
console.log('currentPage',await program.currentPage())
console
.
log
(
'
currentPage
'
,
await
program
.
currentPage
())
}
else
{
}
else
{
console
.
log
(
'
no items
'
);
console
.
log
(
'
no items
'
);
}
}
...
...
testSequencer.js
浏览文件 @
cc60d0e4
const
Sequencer
=
require
(
"
@jest/test-sequencer
"
).
default
;
const
Sequencer
=
require
(
"
@jest/test-sequencer
"
).
default
;
const
sortTestFilenames
=
[
"
add.test.js
"
,
"
list.test.js
"
,
"
detail.test.js
"
,
"
edit.test.js
"
];
const
sortTestFilenames
=
[
"
add.test.js
"
,
"
list.test.js
"
,
"
detail.test.js
"
,
"
edit.test.js
"
,
"
cloudFunction.test.js
"
,
"
clientDB-api.test.js
"
];
class
CustomSequencer
extends
Sequencer
{
class
CustomSequencer
extends
Sequencer
{
sort
(
tests
)
{
sort
(
tests
)
{
// 测试例排序
// 测试例排序
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录