poll.horse/test/setup.ts
Wolvan 8bc3f7fe36 Initial commit
This code serves as an application framework of sorts and is totally not
stolen from some of my other projects.
2021-12-28 21:11:19 +01:00

17 lines
493 B
TypeScript

"use strict";
import fs from "fs-extra";
import { TEST_DIRECTORY } from "./const";
console.log("Setting up Mocha Tests");
export async function mochaGlobalSetup(): Promise<void> {
console.log(`Setting up TEST_DIRECTORY '${TEST_DIRECTORY}'`);
await fs.remove(TEST_DIRECTORY);
await fs.mkdirp(TEST_DIRECTORY);
}
export async function mochaGlobalTeardown(): Promise<void> {
console.log(`Cleaning up TEST_DIRECTORY '${TEST_DIRECTORY}'`);
await fs.remove(TEST_DIRECTORY);
}