Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F8922473
test.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
test.js
View Options
var
Sealious
=
require
(
"sealious"
);
var
requireDir
=
require
(
"require-dir"
);
var
Mocha
=
require
(
'mocha'
);
var
fs
=
require
(
'fs'
);
var
path
=
require
(
'path'
);
// Instantiate a Mocha instance.
var
mocha
=
new
Mocha
();
mocha
.
delay
();
var
testDir
=
path
.
resolve
(
module
.
filename
,
'../unit-tests'
)
// Add each .js file to the mocha instance
fs
.
readdirSync
(
testDir
).
filter
(
function
(
file
){
// Only keep the .js files
return
file
.
substr
(
-
3
)
===
'.js'
;
}).
forEach
(
function
(
file
){
mocha
.
addFile
(
path
.
join
(
testDir
,
file
)
);
});
try
{
fs
.
unlinkSync
(
path
.
resolve
(
module
.
filename
,
"../../db/resources"
));
}
catch
(
e
){
console
.
log
(
"Did not found `db/resources` file"
)
}
var
tests
=
requireDir
(
"./unit-tests"
);
Sealious
.
init
();
for
(
var
i
in
tests
){
tests
[
i
].
test_init
&&
tests
[
i
].
test_init
();
}
Sealious
.
start
().
then
(
function
(){
for
(
var
i
in
tests
){
tests
[
i
].
test_start
&&
tests
[
i
].
test_start
();
}
run
();
})
// Run the tests.
mocha
.
run
(
function
(
failures
){
process
.
on
(
'exit'
,
function
(){
process
.
exit
(
failures
);
});
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 20, 14:38 (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
948316
Default Alt Text
test.js (1 KB)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment