shellphone.app/cypress/plugins/index.ts
2022-05-14 12:22:06 +02:00

23 lines
375 B
TypeScript

import db from "~/utils/db.server";
const plugins: Cypress.PluginConfig = (on, config) => {
on("task", {
async resetDb() {
await emptyDatabase();
return null;
},
});
return {
...config,
baseUrl: "http://localhost:3000",
};
};
module.exports = plugins;
async function emptyDatabase() {
await db.user.deleteMany();
await db.organization.deleteMany();
}