remixed v0
This commit is contained in:
22
cypress/plugins/index.ts
Normal file
22
cypress/plugins/index.ts
Normal file
@ -0,0 +1,22 @@
|
||||
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();
|
||||
}
|
Reference in New Issue
Block a user