wire mailpit and db:promote cypress tasks
This commit is contained in:
parent
30738b163d
commit
7f744410bf
1 changed files with 20 additions and 0 deletions
|
|
@ -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();
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue