-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't fail tests if test api already running
- Loading branch information
Showing
3 changed files
with
706 additions
and
676 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
import path from "path"; | ||
import dotenv from "dotenv"; | ||
import detect from "detect-port"; | ||
import type { Callback } from "lib"; | ||
import server from "../mpr/server"; | ||
|
||
dotenv.config({ path: path.resolve("api", ".env") }); | ||
|
||
export default async function(): Promise<Callback<void>> { | ||
const mpr = await server(3001); | ||
try { | ||
await detect(3001); | ||
const mpr = await server(3001); | ||
|
||
return async function() { | ||
mpr.closeAllConnections(); | ||
await new Promise(resolve => mpr.close(resolve)); | ||
}; | ||
return async function() { | ||
mpr.closeAllConnections(); | ||
await new Promise(resolve => mpr.close(resolve)); | ||
}; | ||
} catch { | ||
return async function() {}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.