Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
test(set-up): clear the stub in case of failure
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Sep 17, 2022
1 parent 5899aa3 commit 33afc65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions t/helpers/set-ups/server.set_up.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import startServer from "!/start_server"

let server: HTTPServer|null = null

beforeAll(async () => {
beforeAll(async() => {
server = await startServer()
})

beforeAll(async () => {
beforeAll(() => {
if (server !== null) {
server.close()
}
Expand Down
6 changes: 6 additions & 0 deletions t/helpers/set-ups/stub.set_up.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Stub from "$/singletons/stub"

afterEach(() => {
// Clear the memory
const unusedPreviousCalls = Stub.consumePreviousCalls()
})

0 comments on commit 33afc65

Please sign in to comment.