Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
34adcb74
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
34adcb74
编写于
4月 13, 2018
作者:
R
Ramya Achutha Rao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Dont depende on workspace settings for tests
上级
ba87894f
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
19 addition
and
16 deletion
+19
-16
extensions/emmet/src/test/abbreviationAction.test.ts
extensions/emmet/src/test/abbreviationAction.test.ts
+13
-11
extensions/emmet/src/test/tagActions.test.ts
extensions/emmet/src/test/tagActions.test.ts
+6
-5
未找到文件。
extensions/emmet/src/test/abbreviationAction.test.ts
浏览文件 @
34adcb74
...
...
@@ -5,7 +5,7 @@
import
'
mocha
'
;
import
*
as
assert
from
'
assert
'
;
import
{
Selection
,
workspace
,
CompletionList
,
CancellationTokenSource
,
CompletionTriggerKind
}
from
'
vscode
'
;
import
{
Selection
,
workspace
,
CompletionList
,
CancellationTokenSource
,
CompletionTriggerKind
,
ConfigurationTarget
}
from
'
vscode
'
;
import
{
withRandomFileEditor
,
closeAllEditors
}
from
'
./testUtils
'
;
import
{
expandEmmetAbbreviation
}
from
'
../abbreviationActions
'
;
import
{
DefaultCompletionItemProvider
}
from
'
../defaultCompletionProvider
'
;
...
...
@@ -36,9 +36,10 @@ const htmlContents = `
`
;
suite
(
'
Tests for Expand Abbreviations (HTML)
'
,
()
=>
{
const
oldValueForExcludeLanguages
=
workspace
.
getConfiguration
(
'
emmet
'
).
inspect
(
'
excludeLanguages
'
);
teardown
(()
=>
{
//
Reset config and
close all editors
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
excludeLanguages
'
,
[]).
then
(
closeAllEditors
)
;
// close all editors
return
closeAllEditors
;
});
test
(
'
Expand snippets (HTML)
'
,
()
=>
{
...
...
@@ -255,25 +256,25 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
// });
test
(
'
No expanding when html is excluded in the settings
'
,
()
=>
{
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
excludeLanguages
'
,
[
'
html
'
]).
then
(()
=>
{
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
excludeLanguages
'
,
[
'
html
'
]
,
ConfigurationTarget
.
Global
).
then
(()
=>
{
return
testExpandAbbreviation
(
'
html
'
,
new
Selection
(
9
,
6
,
9
,
6
),
''
,
''
,
true
).
then
(()
=>
{
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
excludeLanguages
'
,
[]
);
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
excludeLanguages
'
,
oldValueForExcludeLanguages
?
oldValueForExcludeLanguages
.
globalValue
:
undefined
,
ConfigurationTarget
.
Global
);
});
});
});
test
(
'
No expanding when html is excluded in the settings in completion list
'
,
()
=>
{
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
excludeLanguages
'
,
[
'
html
'
]).
then
(()
=>
{
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
excludeLanguages
'
,
[
'
html
'
]
,
ConfigurationTarget
.
Global
).
then
(()
=>
{
return
testHtmlCompletionProvider
(
new
Selection
(
9
,
6
,
9
,
6
),
''
,
''
,
true
).
then
(()
=>
{
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
excludeLanguages
'
,
[]
);
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
excludeLanguages
'
,
oldValueForExcludeLanguages
?
oldValueForExcludeLanguages
.
globalValue
:
undefined
,
ConfigurationTarget
.
Global
);
});
});
});
test
(
'
No expanding when php (mapped syntax) is excluded in the settings
'
,
()
=>
{
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
excludeLanguages
'
,
[
'
php
'
]).
then
(()
=>
{
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
excludeLanguages
'
,
[
'
php
'
]
,
ConfigurationTarget
.
Global
).
then
(()
=>
{
return
testExpandAbbreviation
(
'
php
'
,
new
Selection
(
9
,
6
,
9
,
6
),
''
,
''
,
true
).
then
(()
=>
{
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
excludeLanguages
'
,
[]
);
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
excludeLanguages
'
,
oldValueForExcludeLanguages
?
oldValueForExcludeLanguages
.
globalValue
:
undefined
,
ConfigurationTarget
.
Global
);
});
});
});
...
...
@@ -282,6 +283,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
});
suite
(
'
Tests for jsx, xml and xsl
'
,
()
=>
{
const
oldValueForSyntaxProfiles
=
workspace
.
getConfiguration
(
'
emmet
'
).
inspect
(
'
syntaxProfiles
'
);
teardown
(
closeAllEditors
);
test
(
'
Expand abbreviation with className instead of class in jsx
'
,
()
=>
{
...
...
@@ -305,12 +307,12 @@ suite('Tests for jsx, xml and xsl', () => {
});
test
(
'
Expand abbreviation with single quotes for jsx
'
,
()
=>
{
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
syntaxProfiles
'
,
{
jsx
:
{
"
attr_quotes
"
:
"
single
"
}}).
then
(()
=>
{
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
syntaxProfiles
'
,
{
jsx
:
{
"
attr_quotes
"
:
"
single
"
}}
,
ConfigurationTarget
.
Global
).
then
(()
=>
{
return
withRandomFileEditor
(
'
img
'
,
'
javascriptreact
'
,
(
editor
,
doc
)
=>
{
editor
.
selection
=
new
Selection
(
0
,
6
,
0
,
6
);
return
expandEmmetAbbreviation
({
language
:
'
javascriptreact
'
}).
then
(()
=>
{
assert
.
equal
(
editor
.
document
.
getText
(),
'
<img src=
\'\'
alt=
\'\'
/>
'
);
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
syntaxProfiles
'
,
{}
);
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
syntaxProfiles
'
,
oldValueForSyntaxProfiles
?
oldValueForSyntaxProfiles
.
globalValue
:
undefined
,
ConfigurationTarget
.
Global
);
});
});
});
...
...
extensions/emmet/src/test/tagActions.test.ts
浏览文件 @
34adcb74
...
...
@@ -5,7 +5,7 @@
import
'
mocha
'
;
import
*
as
assert
from
'
assert
'
;
import
{
Selection
,
workspace
}
from
'
vscode
'
;
import
{
Selection
,
workspace
,
ConfigurationTarget
}
from
'
vscode
'
;
import
{
withRandomFileEditor
,
closeAllEditors
}
from
'
./testUtils
'
;
import
{
removeTag
}
from
'
../removeTag
'
;
import
{
updateTag
}
from
'
../updateTag
'
;
...
...
@@ -15,8 +15,8 @@ import { mergeLines } from '../mergeLines';
suite
(
'
Tests for Emmet actions on html tags
'
,
()
=>
{
teardown
(()
=>
{
//
Reset config and
close all editors
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
syntaxProfiles
'
,
{}).
then
(
closeAllEditors
)
;
// close all editors
return
closeAllEditors
;
});
const
contents
=
`
...
...
@@ -116,7 +116,8 @@ suite('Tests for Emmet actions on html tags', () => {
<span></span>
</div>
`
;
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
syntaxProfiles
'
,
{
jsx
:
{
selfClosingStyle
:
'
xhtml
'
}}).
then
(()
=>
{
const
oldValueForSyntaxProfiles
=
workspace
.
getConfiguration
(
'
emmet
'
).
inspect
(
'
syntaxProfiles
'
);
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
syntaxProfiles
'
,
{
jsx
:
{
selfClosingStyle
:
'
xhtml
'
}},
ConfigurationTarget
.
Global
).
then
(()
=>
{
return
withRandomFileEditor
(
contents
,
'
jsx
'
,
(
editor
,
doc
)
=>
{
editor
.
selections
=
[
new
Selection
(
3
,
17
,
3
,
17
),
// join tag
...
...
@@ -125,7 +126,7 @@ suite('Tests for Emmet actions on html tags', () => {
return
splitJoinTag
()
!
.
then
(()
=>
{
assert
.
equal
(
doc
.
getText
(),
expectedContents
);
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
syntaxProfiles
'
,
{}
);
return
workspace
.
getConfiguration
(
'
emmet
'
).
update
(
'
syntaxProfiles
'
,
oldValueForSyntaxProfiles
?
oldValueForSyntaxProfiles
.
globalValue
:
undefined
,
ConfigurationTarget
.
Global
);
});
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录