@samepage/testing
Version:
Utilities that help with testing SamePage-compatible extensions
18 lines • 846 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const fs_1 = tslib_1.__importDefault(require("fs"));
const globalSetup = async () => {
process.env.NODE_ENV = process.env.NODE_ENV || "test";
if (process.env.DEBUG || process.env.PWDEBUG)
process.env.DEBUG = process.env.DEBUG || process.env.PWDEBUG;
if (fs_1.default.existsSync(`${process.cwd()}/tests/config.ts`)) {
await Promise.resolve(`${`${process.cwd()}/tests/config`}`).then(s => tslib_1.__importStar(require(s))).then(
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
(mod) => typeof mod.setup === "function" && mod.setup())
.catch((e) => console.error(e));
}
};
exports.default = globalSetup;
//# sourceMappingURL=globalSetup.js.map