Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F1374602
test.cjs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
995 B
Referenced Files
None
Subscribers
None
test.cjs
View Options
const
mri
=
require
(
"mri"
);
const
{
spawn
}
=
require
(
"child_process"
);
const
argv
=
process
.
argv
.
slice
(
2
);
const
args
=
mri
(
argv
);
const
bin_dir
=
"./node_modules/.bin/"
;
const
mocha
=
bin_dir
+
"mocha"
;
let
mocha_options
=
[
"--recursive"
,
"--timeout=10000"
,
"--require"
,
"source-map-support/register"
,
];
if
(
args
[
"test-report"
])
{
mocha_options
=
[
...
mocha_options
,
// "--require",
// "ts-node/register",
// "--require",
// "./src/http/type-overrides.ts",
"--reporter"
,
"xunit"
,
"--reporter-option"
,
"output=.xunit"
,
];
}
const
mocha_files
=
[
"lib/src/**/*.test.js"
];
let
command
=
[
mocha
,
...
mocha_options
,
...
mocha_files
];
if
(
args
.
debug
)
{
command
=
[
"node"
,
"inspect"
,
...
command
];
}
console
.
log
(
"spawning mocha..."
,
command
.
join
(
" "
));
const
proc
=
spawn
(
command
[
0
],
command
.
slice
(
1
),
{
stdio
:
"inherit"
,
env
:
process
.
env
,
});
proc
.
on
(
"exit"
,
function
(
code
)
{
if
(
args
[
"test-report"
])
{
process
.
exit
(
0
);
}
else
{
process
.
exit
(
code
);
}
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 25, 03:06 (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
610426
Default Alt Text
test.cjs (995 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment