wire mailpit and db:promote cypress tasks

This commit is contained in:
Yisroel Baum 2026-05-06 23:23:13 +03:00
parent 30738b163d
commit 7f744410bf
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -3,6 +3,7 @@ import { execSync } from "node:child_process";
import { resolve } from "node:path";
const backendDir = resolve(__dirname, "../../backend");
const mailpitBase = "http://localhost:8025/api/v1";
export default defineConfig({
e2e: {
@ -23,6 +24,25 @@ export default defineConfig({
});
return null;
},
"db:promote": function (email: string) {
execSync(`php artisan user:promote ${JSON.stringify(email)}`, {
cwd: backendDir,
stdio: "pipe",
});
return null;
},
"mailpit:clear": async function () {
await fetch(`${mailpitBase}/messages`, { method: "DELETE" });
return null;
},
"mailpit:messages": async function () {
const response = await fetch(`${mailpitBase}/messages`);
return response.json();
},
"mailpit:message": async function (id: string) {
const response = await fetch(`${mailpitBase}/message/${id}`);
return response.json();
},
});
},
},