Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5e8dabc1
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,发现更多精彩内容 >>
未验证
提交
5e8dabc1
编写于
2月 07, 2020
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move test/all.js to test/unit/node/all.js
上级
e48debc9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
44 deletion
+22
-44
package.json
package.json
+1
-1
test/unit/node/all.js
test/unit/node/all.js
+21
-43
未找到文件。
package.json
浏览文件 @
5e8dabc1
...
...
@@ -15,7 +15,7 @@
"compile"
:
"gulp compile --max_old_space_size=4095"
,
"watch"
:
"gulp watch --max_old_space_size=4095"
,
"watch-client"
:
"gulp watch-client --max_old_space_size=4095"
,
"mo
naco-editor-test"
:
"mocha --only-monaco-editor
"
,
"mo
cha"
:
"mocha test/unit/node/all.js --delay
"
,
"precommit"
:
"node build/gulpfile.hygiene.js"
,
"gulp"
:
"gulp --max_old_space_size=8192"
,
"electron"
:
"node build/lib/electron"
,
...
...
test/all.js
→
test/
unit/node/
all.js
浏览文件 @
5e8dabc1
...
...
@@ -11,38 +11,38 @@ const path = require('path');
const
glob
=
require
(
'
glob
'
);
const
jsdom
=
require
(
'
jsdom-no-contextify
'
);
const
TEST_GLOB
=
'
**/test/**/*.test.js
'
;
const
coverage
=
require
(
'
./coverage
'
);
const
coverage
=
require
(
'
.
./..
/coverage
'
);
var
optimist
=
require
(
'
optimist
'
)
const
optimist
=
require
(
'
optimist
'
)
.
usage
(
'
Run the Code tests. All mocha options apply.
'
)
.
describe
(
'
build
'
,
'
Run from out-build
'
).
boolean
(
'
build
'
)
.
describe
(
'
run
'
,
'
Run a single file
'
).
string
(
'
run
'
)
.
describe
(
'
coverage
'
,
'
Generate a coverage report
'
).
boolean
(
'
coverage
'
)
.
describe
(
'
only-monaco-editor
'
,
'
Run only monaco editor tests
'
).
boolean
(
'
only-monaco-editor
'
)
.
describe
(
'
browser
'
,
'
Run tests in a browser
'
).
boolean
(
'
browser
'
)
.
alias
(
'
h
'
,
'
help
'
).
boolean
(
'
h
'
)
.
describe
(
'
h
'
,
'
Show help
'
);
var
argv
=
optimist
.
argv
;
const
argv
=
optimist
.
argv
;
if
(
argv
.
help
)
{
optimist
.
showHelp
();
process
.
exit
(
1
);
}
var
out
=
argv
.
build
?
'
out-build
'
:
'
out
'
;
var
loader
=
require
(
'
../
'
+
out
+
'
/vs/loader
'
);
var
src
=
path
.
join
(
path
.
dirname
(
__dirname
),
out
);
const
REPO_ROOT
=
path
.
join
(
__dirname
,
'
../../../
'
);
const
out
=
argv
.
build
?
'
out-build
'
:
'
out
'
;
const
loader
=
require
(
`../../../
${
out
}
/vs/loader`
);
const
src
=
path
.
join
(
REPO_ROOT
,
out
);
function
main
()
{
process
.
on
(
'
uncaughtException
'
,
function
(
e
)
{
console
.
error
(
e
.
stack
||
e
);
});
var
loaderConfig
=
{
const
loaderConfig
=
{
nodeRequire
:
require
,
nodeMain
:
__filename
,
baseUrl
:
path
.
join
(
path
.
dirname
(
__dirname
)
,
'
src
'
),
baseUrl
:
path
.
join
(
REPO_ROOT
,
'
src
'
),
paths
:
{
'
vs/css
'
:
'
../test/css.mock
'
,
'
vs
'
:
`../
${
out
}
/vs`
,
...
...
@@ -75,17 +75,17 @@ function main() {
global
.
navigator
=
global
.
window
.
navigator
;
global
.
XMLHttpRequest
=
global
.
window
.
XMLHttpRequest
;
var
didErr
=
false
;
var
write
=
process
.
stderr
.
write
;
let
didErr
=
false
;
const
write
=
process
.
stderr
.
write
;
process
.
stderr
.
write
=
function
(
data
)
{
didErr
=
didErr
||
!!
data
;
write
.
apply
(
process
.
stderr
,
arguments
);
};
var
loadFunc
=
null
;
let
loadFunc
=
null
;
if
(
argv
.
runGlob
)
{
loadFunc
=
cb
=>
{
loadFunc
=
(
cb
)
=>
{
const
doRun
=
tests
=>
{
const
modulesToLoad
=
tests
.
map
(
test
=>
{
if
(
path
.
isAbsolute
(
test
))
{
...
...
@@ -100,41 +100,19 @@ function main() {
glob
(
argv
.
runGlob
,
{
cwd
:
src
},
function
(
err
,
files
)
{
doRun
(
files
);
});
};
}
else
if
(
argv
.
run
)
{
var
tests
=
(
typeof
argv
.
run
===
'
string
'
)
?
[
argv
.
run
]
:
argv
.
run
;
var
modulesToLoad
=
tests
.
map
(
function
(
test
)
{
const
tests
=
(
typeof
argv
.
run
===
'
string
'
)
?
[
argv
.
run
]
:
argv
.
run
;
const
modulesToLoad
=
tests
.
map
(
function
(
test
)
{
test
=
test
.
replace
(
/^src/
,
'
out
'
);
test
=
test
.
replace
(
/
\.
ts$/
,
'
.js
'
);
return
path
.
relative
(
src
,
path
.
resolve
(
test
)).
replace
(
/
(\.
js
)
|
(\.
js
\.
map
)
$/
,
''
).
replace
(
/
\\
/g
,
'
/
'
);
});
loadFunc
=
cb
=>
{
loadFunc
=
(
cb
)
=>
{
define
(
modulesToLoad
,
()
=>
cb
(
null
),
cb
);
};
}
else
if
(
argv
[
'
only-monaco-editor
'
])
{
loadFunc
=
function
(
cb
)
{
glob
(
TEST_GLOB
,
{
cwd
:
src
},
function
(
err
,
files
)
{
var
modulesToLoad
=
files
.
map
(
function
(
file
)
{
return
file
.
replace
(
/
\.
js$/
,
''
);
});
modulesToLoad
=
modulesToLoad
.
filter
(
function
(
module
)
{
if
(
/^vs
\/
workbench
\/
/
.
test
(
module
))
{
return
false
;
}
// platform tests drag in the workbench.
// see https://github.com/Microsoft/vscode/commit/12eaba2f64c69247de105c3d9c47308ac6e44bc9
// and cry a little
if
(
/^vs
\/
platform
\/
/
.
test
(
module
))
{
return
false
;
}
return
!
/
(\/
|
\\)
node
(\/
|
\\)
/
.
test
(
module
);
});
console
.
log
(
JSON
.
stringify
(
modulesToLoad
,
null
,
'
\t
'
));
define
(
modulesToLoad
,
function
()
{
cb
(
null
);
},
cb
);
});
};
}
else
{
loadFunc
=
function
(
cb
)
{
loadFunc
=
(
cb
)
=>
{
glob
(
TEST_GLOB
,
{
cwd
:
src
},
function
(
err
,
files
)
{
var
modulesToLoad
=
files
.
map
(
function
(
file
)
{
const
modulesToLoad
=
files
.
map
(
function
(
file
)
{
return
file
.
replace
(
/
\.
js$/
,
''
);
});
define
(
modulesToLoad
,
function
()
{
cb
(
null
);
},
cb
);
...
...
@@ -160,7 +138,7 @@ function main() {
}
// report failing test for every unexpected error during any of the tests
var
unexpectedErrors
=
[];
let
unexpectedErrors
=
[];
suite
(
'
Errors
'
,
function
()
{
test
(
'
should not have unexpected errors in tests
'
,
function
()
{
if
(
unexpectedErrors
.
length
)
{
...
...
@@ -177,7 +155,7 @@ function main() {
// replace the default unexpected error handler to be useful during tests
loader
([
'
vs/base/common/errors
'
],
function
(
errors
)
{
errors
.
setUnexpectedErrorHandler
(
function
(
err
)
{
le
t
stack
=
(
err
&&
err
.
stack
)
||
(
new
Error
().
stack
);
cons
t
stack
=
(
err
&&
err
.
stack
)
||
(
new
Error
().
stack
);
unexpectedErrors
.
push
((
err
&&
err
.
message
?
err
.
message
:
err
)
+
'
\n
'
+
stack
);
});
...
...
@@ -188,7 +166,7 @@ function main() {
}
if
(
process
.
argv
.
some
(
function
(
a
)
{
return
/^--browser/
.
test
(
a
);
}))
{
require
(
'
./browser
'
);
require
(
'
.
./..
/browser
'
);
}
else
{
main
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录