Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
16a54dac
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
16a54dac
编写于
5月 23, 2018
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add helpers for repeating mocha tests, and a search smoketest helper
上级
8bf066e3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
1 deletion
+40
-1
src/vs/base/test/common/utils.ts
src/vs/base/test/common/utils.ts
+13
-1
test/smoke/src/areas/search/search.ts
test/smoke/src/areas/search/search.ts
+4
-0
test/smoke/src/utils.ts
test/smoke/src/utils.ts
+23
-0
未找到文件。
src/vs/base/test/common/utils.ts
浏览文件 @
16a54dac
...
...
@@ -5,10 +5,10 @@
'
use strict
'
;
import
{
TPromise
,
PPromise
,
TValueCallback
,
TProgressCallback
,
ProgressCallback
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
*
as
paths
from
'
vs/base/common/paths
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
PPromise
,
ProgressCallback
,
TProgressCallback
,
TPromise
,
TValueCallback
}
from
'
vs/base/common/winjs.base
'
;
export
class
DeferredTPromise
<
T
>
extends
TPromise
<
T
>
{
...
...
@@ -82,3 +82,15 @@ export class DeferredPPromise<C, P> extends PPromise<C, P> {
export
function
toResource
(
this
:
any
,
path
:
string
)
{
return
URI
.
file
(
paths
.
join
(
'
C:
\\
'
,
Buffer
.
from
(
this
.
test
.
fullTitle
()).
toString
(
'
base64
'
),
path
));
}
export
function
suiteRepeat
(
n
:
number
,
description
:
string
,
callback
:
(
this
:
any
)
=>
void
):
void
{
for
(
let
i
=
0
;
i
<
n
;
i
++
)
{
suite
(
`
${
description
}
(iteration
${
i
}
)`
,
callback
);
}
}
export
function
testRepeat
(
n
:
number
,
description
:
string
,
callback
:
(
this
:
any
,
done
:
MochaDone
)
=>
any
):
void
{
for
(
let
i
=
0
;
i
<
n
;
i
++
)
{
test
(
`
${
description
}
(iteration
${
i
}
)`
,
callback
);
}
}
test/smoke/src/areas/search/search.ts
浏览文件 @
16a54dac
...
...
@@ -63,6 +63,10 @@ export class Search extends Viewlet {
await
this
.
code
.
waitAndClick
(
`
${
VIEWLET
}
.search-widget .monaco-button.toggle-replace-button.collapse`
);
}
async
collapseReplace
():
Promise
<
void
>
{
await
this
.
code
.
waitAndClick
(
`
${
VIEWLET
}
.search-widget .monaco-button.toggle-replace-button.expand`
);
}
async
setReplaceText
(
text
:
string
):
Promise
<
void
>
{
await
this
.
code
.
waitAndClick
(
`
${
VIEWLET
}
.search-widget .replace-container .monaco-inputbox input[title="Replace"]`
);
await
this
.
code
.
waitForElement
(
`
${
VIEWLET
}
.search-widget .replace-container .monaco-inputbox.synthetic-focus input[title="Replace"]`
);
...
...
test/smoke/src/utils.ts
0 → 100644
浏览文件 @
16a54dac
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
ISuiteCallbackContext
,
ITestCallbackContext
}
from
'
mocha
'
;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export
function
describeRepeat
(
n
:
number
,
description
:
string
,
callback
:
(
this
:
ISuiteCallbackContext
)
=>
void
):
void
{
for
(
let
i
=
0
;
i
<
n
;
i
++
)
{
describe
(
`
${
description
}
(iteration
${
i
}
)`
,
callback
);
}
}
export
function
itRepeat
(
n
:
number
,
description
:
string
,
callback
:
(
this
:
ITestCallbackContext
,
done
:
MochaDone
)
=>
any
):
void
{
for
(
let
i
=
0
;
i
<
n
;
i
++
)
{
it
(
`
${
description
}
(iteration
${
i
}
)`
,
callback
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录