PPPAIMT-Crest/e2e/global-teardown.js

21 lines
626 B
JavaScript

import path from 'node:path';
import { pathToFileURL } from 'node:url';
import dotenv from 'dotenv';
const root = process.cwd();
export default async function globalTeardown() {
dotenv.config({ path: path.join(root, 'backend/.env'), quiet: true });
process.env.DB_NAME = 'ppaimt_crest_test';
const { default: knex } = await import('knex');
const { default: config } = await import(
pathToFileURL(path.join(root, 'backend/knexfile.js')).href
);
const db = knex(config);
await db('settings')
.where({ key: 'signatory_signature_key' })
.update({ value: JSON.stringify('') });
await db.destroy();
}