Skip to content

Commit

Permalink
debug (#1157)
Browse files Browse the repository at this point in the history

* make sure session create is async
  • Loading branch information
paulr34 authored Oct 2, 2023
1 parent b241c2a commit bc2ca3c
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions test/server-bare.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ describe('Session specific tests', () => {
'http server initialization',
async () => {
await httpServer.initHttpServer(db, port)
axiosInstance
.post(`${restApi.uri.sessionCreate}?sessionId=${uuid}`)
},
testUtil.timeout.medium()
)
Expand All @@ -98,10 +96,17 @@ describe('Session specific tests', () => {
test(
'make sure there is still no session after index.html',
() =>
testQuery.selectCountFrom(db, 'SESSION').then((cnt) => {
expect(cnt).toBe(0)
}),
testUtil.timeout.medium()
testQuery
.selectCountFrom(db, 'SESSION')
.then((cnt) => {
expect(cnt).toBe(0)
})
.then(async () => {
await axiosInstance.post(
`${restApi.uri.sessionCreate}?sessionId=${uuid}`
)
}),
testUtil.timeout.short()
)

test(
Expand All @@ -117,7 +122,7 @@ describe('Session specific tests', () => {

test(
'make sure there is 1 session after previous call',
() =>
async () =>
testQuery.selectCountFrom(db, 'SESSION').then((cnt) => {
expect(cnt).toBe(1)
}),
Expand Down

0 comments on commit bc2ca3c

Please sign in to comment.