Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F995203
datastore.test.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
datastore.test.ts
View Options
import
{
withRunningApp
}
from
"../test_utils/with-test-app"
;
import
{
assertThrowsAsync
}
from
"../test_utils/assert-throws-async"
;
import
assert
from
"assert"
;
describe
(
"datastore"
,
()
=>
{
afterEach
(()
=>
{
delete
process
.
env
.
SEALIOUS_DB_PORT
;
});
it
(
"timeouts with incorrect config"
,
async
()
=>
{
const
fakePort
=
20725
;
process
.
env
.
SEALIOUS_DB_PORT
=
"20725"
;
await
assertThrowsAsync
(
async
()
=>
{
await
withRunningApp
(
(
app
)
=>
app
,
async
()
=>
null
);
},
(
e
:
Error
)
=>
{
const
url
=
`mongodb://127.0.0.1:
${
fakePort
}
/sealious-test`
;
assert
.
strictEqual
(
e
.
message
,
`MongoDB was not found at the following address:
${
url
}
. Please make sure database is running.`
);
}
);
});
it
(
"works with correct config"
,
async
()
=>
{
let
error
:
unknown
=
null
;
try
{
await
withRunningApp
(
(
app
)
=>
app
,
async
()
=>
null
);
}
catch
(
e
:
unknown
)
{
error
=
e
;
}
finally
{
assert
.
strictEqual
(
error
,
null
,
"It didn't throw"
);
}
});
});
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Mon, Dec 23, 00:54 (4 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
556711
Default Alt Text
datastore.test.ts (1 KB)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment