Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
baa380d1
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,发现更多精彩内容 >>
未验证
提交
baa380d1
编写于
10月 22, 2021
作者:
C
Connor Peet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
testing: adopt optional value standard
For #124362
上级
2ada30a9
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
18 addition
and
16 deletion
+18
-16
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+10
-10
src/vs/workbench/api/common/extHostTypeConverters.ts
src/vs/workbench/api/common/extHostTypeConverters.ts
+2
-0
src/vs/workbench/api/common/extHostTypes.ts
src/vs/workbench/api/common/extHostTypes.ts
+3
-3
src/vs/workbench/test/browser/api/extHostTesting.test.ts
src/vs/workbench/test/browser/api/extHostTesting.test.ts
+3
-3
未找到文件。
src/vs/vscode.d.ts
浏览文件 @
baa380d1
...
...
@@ -14102,7 +14102,7 @@ declare module 'vscode' {
* Associated tag for the profile. If this is set, only {@link TestItem}
* instances with the same tag will be eligible to execute in this profile.
*/
tag
?:
TestTag
;
tag
:
TestTag
|
undefined
;
/**
* If this method is present, a configuration gear will be present in the
...
...
@@ -14110,7 +14110,7 @@ declare module 'vscode' {
* you can take other editor actions, such as showing a quick pick or
* opening a configuration file.
*/
configureHandler
?:
()
=>
voi
d
;
configureHandler
:
(()
=>
void
)
|
undefine
d
;
/**
* Handler called to start a test run. When invoked, the function should call
...
...
@@ -14259,7 +14259,7 @@ declare module 'vscode' {
* The process of running tests should resolve the children of any test
* items who have not yet been resolved.
*/
readonly
include
?:
TestItem
[]
;
readonly
include
:
TestItem
[]
|
undefined
;
/**
* An array of tests the user has marked as excluded from the test included
...
...
@@ -14268,14 +14268,14 @@ declare module 'vscode' {
* May be omitted if no exclusions were requested. Test controllers should
* not run excluded tests or any children of excluded tests.
*/
readonly
exclude
?:
TestItem
[]
;
readonly
exclude
:
TestItem
[]
|
undefined
;
/**
* The profile used for this request. This will always be defined
* for requests issued from the editor UI, though extensions may
* programmatically create requests not associated with any profile.
*/
readonly
profile
?:
TestRunProfile
;
readonly
profile
:
TestRunProfile
|
undefined
;
/**
* @param tests Array of specific tests to run, or undefined to run all tests
...
...
@@ -14294,7 +14294,7 @@ declare module 'vscode' {
* disambiguate multiple sets of results in a test run. It is useful if
* tests are run across multiple platforms, for example.
*/
readonly
name
?:
string
;
readonly
name
:
string
|
undefined
;
/**
* A cancellation token which will be triggered when the test run is
...
...
@@ -14434,7 +14434,7 @@ declare module 'vscode' {
/**
* URI this `TestItem` is associated with. May be a file or directory.
*/
readonly
uri
?:
Uri
;
readonly
uri
:
Uri
|
undefined
;
/**
* The children of this test item. For a test suite, this may contain the
...
...
@@ -14447,7 +14447,7 @@ declare module 'vscode' {
* top-level items in the {@link TestController.items} and for items that
* aren't yet included in another item's {@link children}.
*/
readonly
parent
?:
TestItem
;
readonly
parent
:
TestItem
|
undefined
;
/**
* Tags associated with this test item. May be used in combination with
...
...
@@ -14489,7 +14489,7 @@ declare module 'vscode' {
*
* This is only meaningful if the `uri` points to a file.
*/
range
?:
Range
;
range
:
Range
|
undefined
;
/**
* Optional error encountered while loading the test.
...
...
@@ -14497,7 +14497,7 @@ declare module 'vscode' {
* Note that this is not a test result and should only be used to represent errors in
* test discovery, such as syntax errors.
*/
error
?:
string
|
MarkdownString
;
error
:
string
|
MarkdownString
|
undefined
;
}
/**
...
...
src/vs/workbench/api/common/extHostTypeConverters.ts
浏览文件 @
baa380d1
...
...
@@ -1728,6 +1728,8 @@ export namespace TestItem {
export
function
toPlain
(
item
:
ITestItem
):
Omit
<
vscode
.
TestItem
,
'
children
'
|
'
invalidate
'
|
'
discoverChildren
'
>
{
return
{
parent
:
undefined
,
error
:
undefined
,
id
:
TestId
.
fromString
(
item
.
extId
).
localId
,
label
:
item
.
label
,
uri
:
URI
.
revive
(
item
.
uri
),
...
...
src/vs/workbench/api/common/extHostTypes.ts
浏览文件 @
baa380d1
...
...
@@ -3328,9 +3328,9 @@ export enum TestRunProfileKind {
@
es5ClassCompat
export
class
TestRunRequest
implements
vscode
.
TestRunRequest
{
constructor
(
public
readonly
include
?:
vscode
.
TestItem
[]
,
public
readonly
exclude
?:
vscode
.
TestItem
[]
|
undefined
,
public
readonly
profile
?:
vscode
.
TestRunProfile
,
public
readonly
include
:
vscode
.
TestItem
[]
|
undefined
=
undefined
,
public
readonly
exclude
:
vscode
.
TestItem
[]
|
undefined
=
undefined
,
public
readonly
profile
:
vscode
.
TestRunProfile
|
undefined
=
undefined
,
)
{
}
}
...
...
src/vs/workbench/test/browser/api/extHostTesting.test.ts
浏览文件 @
baa380d1
...
...
@@ -7,16 +7,16 @@ import * as assert from 'assert';
import
{
VSBuffer
}
from
'
vs/base/common/buffer
'
;
import
{
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
{
Iterable
}
from
'
vs/base/common/iterator
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
mockObject
,
MockObject
}
from
'
vs/base/test/common/mock
'
;
import
{
MainThreadTestingShape
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
TestRunCoordinator
,
TestRunDto
,
TestRunProfileImpl
}
from
'
vs/workbench/api/common/extHostTesting
'
;
import
*
as
convert
from
'
vs/workbench/api/common/extHostTypeConverters
'
;
import
{
TestMessage
,
TestResultState
,
TestRunProfileKind
,
TestTag
,
Location
,
Position
,
Range
}
from
'
vs/workbench/api/common/extHostTypes
'
;
import
{
Location
,
Position
,
Range
,
TestMessage
,
TestResultState
,
TestRunProfileKind
,
TestRunRequest
as
TestRunRequestImpl
,
TestTag
}
from
'
vs/workbench/api/common/extHostTypes
'
;
import
{
TestDiffOpType
,
TestItemExpandState
,
TestMessageType
}
from
'
vs/workbench/contrib/testing/common/testCollection
'
;
import
{
TestId
}
from
'
vs/workbench/contrib/testing/common/testId
'
;
import
{
TestItemImpl
,
testStubs
}
from
'
vs/workbench/contrib/testing/common/testStubs
'
;
import
{
TestSingleUseCollection
}
from
'
vs/workbench/contrib/testing/test/common/ownedTestCollection
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
type
{
TestItem
,
TestRunRequest
}
from
'
vscode
'
;
const
simplify
=
(
item
:
TestItem
)
=>
({
...
...
@@ -654,7 +654,7 @@ suite('ExtHost Testing', () => {
const
childB
=
new
TestItemImpl
(
'
ctrlId
'
,
'
id-child
'
,
'
child
'
,
undefined
);
testB
!
.
children
.
replace
([
childB
]);
const
task1
=
c
.
createTestRun
(
'
ctrl
'
,
single
,
{}
,
'
hello world
'
,
false
);
const
task1
=
c
.
createTestRun
(
'
ctrl
'
,
single
,
new
TestRunRequestImpl
()
,
'
hello world
'
,
false
);
const
tracker
=
Iterable
.
first
(
c
.
trackers
)
!
;
task1
.
passed
(
childA
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录