Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
3f9af31b
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,发现更多精彩内容 >>
未验证
提交
3f9af31b
编写于
7月 19, 2021
作者:
C
Connor Peet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
testing: update test types for feedback
上级
d22e9b4e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
11 addition
and
27 deletion
+11
-27
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+7
-23
src/vs/workbench/api/common/extHostTesting.ts
src/vs/workbench/api/common/extHostTesting.ts
+1
-1
src/vs/workbench/api/common/extHostTestingPrivateApi.ts
src/vs/workbench/api/common/extHostTestingPrivateApi.ts
+1
-1
src/vs/workbench/test/browser/api/extHostTesting.test.ts
src/vs/workbench/test/browser/api/extHostTesting.test.ts
+2
-2
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
3f9af31b
...
...
@@ -1901,22 +1901,6 @@ declare module 'vscode' {
Coverage
=
3
,
}
/**
* Handler called to start a test run. When invoked, the function should
* {@link TestController.createTestRun} at least once, and all tasks
* associated with the run should be created before the function returns
* or the reutrned promise is resolved.
*
* @param request Request information for the test run
* @param cancellationToken Token that signals the used asked to abort the
* test run. If cancellation is requested on this token, all {@link TestRun}
* instances associated with the request will be
* automatically cancelled as well.
*/
// todo@api We have been there with NotebookCtrl#executeHandler and I believe the recommendation is still not to inline.
// At least with that we can still do it later
export
type
TestRunHandler
=
(
request
:
TestRunRequest
,
token
:
CancellationToken
)
=>
Thenable
<
void
>
|
void
;
/**
* A TestRunProfile describes one way to execute tests in a {@link TestController}.
*/
...
...
@@ -1955,10 +1939,10 @@ declare module 'vscode' {
configureHandler
?:
()
=>
void
;
/**
*
Starts a test run. When called, the profile should call
* {@link TestController.createTestRun}
. All tasks associated with the
*
run should be created before the function returns or the reutrned
* promise is resolved.
*
Handler called to start a test run. When invoked, the function should
* {@link TestController.createTestRun}
at least once, and all tasks
*
associated with the run should be created before the function returns
*
or the reutrned
promise is resolved.
*
* @param request Request information for the test run
* @param cancellationToken Token that signals the used asked to abort the
...
...
@@ -1966,7 +1950,7 @@ declare module 'vscode' {
* instances associated with the request will be
* automatically cancelled as well.
*/
runHandler
:
TestRunHandler
;
runHandler
:
(
request
:
TestRunRequest
,
token
:
CancellationToken
)
=>
Thenable
<
void
>
|
void
;
/**
* Deletes the run profile.
...
...
@@ -2014,7 +1998,7 @@ declare module 'vscode' {
* @param runHandler Function called to start a test run
* @param isDefault Whether this is the default action for the group
*/
createRunProfile
(
label
:
string
,
group
:
TestRunProfileGroup
,
runHandler
:
TestRunHandler
,
isDefault
?:
boolean
):
TestRunProfile
;
createRunProfile
(
label
:
string
,
group
:
TestRunProfileGroup
,
runHandler
:
(
request
:
TestRunRequest
,
token
:
CancellationToken
)
=>
Thenable
<
void
>
|
void
,
isDefault
?:
boolean
):
TestRunProfile
;
/**
* A function provided by the extension that the editor may call to request
...
...
@@ -2158,7 +2142,7 @@ declare module 'vscode' {
* Collection of test items, found in {@link TestItem.children} and
* {@link TestController.items}.
*/
export
interface
TestItemCollection
extends
Iterable
<
TestItem
>
{
export
interface
TestItemCollection
{
/**
* Updates the items stored by the collection.
* @param items Items to store, can be an array or other iterable.
...
...
src/vs/workbench/api/common/extHostTesting.ts
浏览文件 @
3f9af31b
...
...
@@ -868,7 +868,7 @@ export class TestRunProfileImpl implements vscode.TestRunProfile {
public
readonly
profileId
:
number
,
private
_label
:
string
,
public
readonly
group
:
vscode
.
TestRunProfileGroup
,
public
runHandler
:
vscode
.
TestRunHandler
,
public
runHandler
:
(
request
:
vscode
.
TestRunRequest
,
token
:
vscode
.
CancellationToken
)
=>
Thenable
<
void
>
|
void
,
private
_isDefault
=
false
,
)
{
this
.
#
proxy
=
proxy
;
...
...
src/vs/workbench/api/common/extHostTestingPrivateApi.ts
浏览文件 @
3f9af31b
...
...
@@ -145,7 +145,7 @@ export class InvalidTestItemError extends Error {
}
}
export
type
TestItemCollectionImpl
=
vscode
.
TestItemCollection
&
{
toJSON
():
readonly
TestItemImpl
[]
};
export
type
TestItemCollectionImpl
=
vscode
.
TestItemCollection
&
{
toJSON
():
readonly
TestItemImpl
[]
}
&
Iterable
<
TestItemImpl
>
;
export
const
createTestItemCollection
=
(
owningItem
:
TestItemImpl
):
TestItemCollectionImpl
=>
{
const
api
=
getPrivateApiFor
(
owningItem
);
...
...
src/vs/workbench/test/browser/api/extHostTesting.test.ts
浏览文件 @
3f9af31b
...
...
@@ -25,7 +25,7 @@ const simplify = (item: TestItem) => ({
range
:
item
.
range
,
});
const
assertTreesEqual
=
(
a
:
TestItem
|
undefined
,
b
:
TestItem
|
undefined
)
=>
{
const
assertTreesEqual
=
(
a
:
TestItem
Impl
|
undefined
,
b
:
TestItemImpl
|
undefined
)
=>
{
if
(
!
a
)
{
throw
new
assert
.
AssertionError
({
message
:
'
Expected a to be defined
'
,
actual
:
a
});
}
...
...
@@ -39,7 +39,7 @@ const assertTreesEqual = (a: TestItem | undefined, b: TestItem | undefined) => {
const
aChildren
=
[...
a
.
children
].
map
(
c
=>
c
.
id
).
sort
();
const
bChildren
=
[...
b
.
children
].
map
(
c
=>
c
.
id
).
sort
();
assert
.
strictEqual
(
aChildren
.
length
,
bChildren
.
length
,
`expected
${
a
.
label
}
.children.length ==
${
b
.
label
}
.children.length`
);
aChildren
.
forEach
(
key
=>
assertTreesEqual
(
a
.
children
.
get
(
key
)
,
b
.
children
.
get
(
key
)
));
aChildren
.
forEach
(
key
=>
assertTreesEqual
(
a
.
children
.
get
(
key
)
as
TestItemImpl
,
b
.
children
.
get
(
key
)
as
TestItemImpl
));
};
// const assertTreeListEqual = (a: ReadonlyArray<TestItem>, b: ReadonlyArray<TestItem>) => {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录