Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2890824
index.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
753 B
Referenced Files
None
Subscribers
None
index.ts
View Options
import
*
as
path
from
'path'
;
import
*
as
Mocha
from
'mocha'
;
import
*
as
glob
from
'glob'
;
export
function
run
()
:
Promise
<
void
>
{
// Create the mocha test
const
mocha
=
new
Mocha
({
ui
:
'tdd'
,
color
:
true
});
const
testsRoot
=
path
.
resolve
(
__dirname
,
'..'
);
return
new
Promise
((
c
,
e
)
=>
{
glob
(
'**/**.test.js'
,
{
cwd
:
testsRoot
},
(
err
,
files
)
=>
{
if
(
err
)
{
return
e
(
err
);
}
// Add files to the test suite
files
.
forEach
(
f
=>
mocha
.
addFile
(
path
.
resolve
(
testsRoot
,
f
)));
try
{
// Run the mocha test
mocha
.
run
(
failures
=>
{
if
(
failures
>
0
)
{
e
(
new
Error
(
`
${
failures
}
tests failed.`
));
}
else
{
c
();
}
});
}
catch
(
err
)
{
console
.
error
(
err
);
e
(
err
);
}
});
});
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Sun, Jan 19, 14:10 (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1125376
Default Alt Text
index.ts (753 B)
Attached To
Mode
R7 arc-vscode
Attached
Detach File
Event Timeline
Log In to Comment