2022-09-09 22:46:53 +00:00
|
|
|
import { exec } from "child_process";
|
|
|
|
import * as config from "./config";
|
2022-09-04 02:42:03 +00:00
|
|
|
|
|
|
|
export const setup = () => {
|
2022-09-09 22:46:53 +00:00
|
|
|
console.log("Starting Client Tests");
|
2022-09-04 02:42:03 +00:00
|
|
|
console.log({
|
|
|
|
PORT: config.PORT,
|
|
|
|
HOST: config.HOST,
|
|
|
|
BASE_URL: config.BASE_URL,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export const teardown = () => {
|
|
|
|
if (process.env.TEST_SHUTDOWN_API_SERVER) {
|
2022-09-09 22:46:53 +00:00
|
|
|
const pc = exec("pkill -SIGTERM api"); // Kill background API process
|
2023-02-18 06:41:01 +00:00
|
|
|
pc.stdout?.on("data", data => {
|
2022-09-04 02:42:03 +00:00
|
|
|
console.log(`stdout: ${data}`);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|