mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-17 10:11:31 +10:00
refactor(v4.0.0-alpha): beginning of a new era
This commit is contained in:
10
apps/server-e2e/src/server/health.spec.ts
Normal file
10
apps/server-e2e/src/server/health.spec.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import axios from "axios";
|
||||
|
||||
describe("GET /api/health", () => {
|
||||
it("should return a status 'ok'", async () => {
|
||||
const res = await axios.get(`/health`);
|
||||
|
||||
expect(res.status).toBe(200);
|
||||
expect(res.data).toMatchObject({ status: "ok" });
|
||||
});
|
||||
});
|
||||
10
apps/server-e2e/src/support/global-setup.ts
Normal file
10
apps/server-e2e/src/support/global-setup.ts
Normal file
@ -0,0 +1,10 @@
|
||||
/* eslint-disable */
|
||||
var __TEARDOWN_MESSAGE__: string;
|
||||
|
||||
module.exports = async function () {
|
||||
// Start services that that the app needs to run (e.g. database, docker-compose, etc.).
|
||||
console.log("\nSetting up...\n");
|
||||
|
||||
// Hint: Use `globalThis` to pass variables to global teardown.
|
||||
globalThis.__TEARDOWN_MESSAGE__ = "\nTearing down...\n";
|
||||
};
|
||||
6
apps/server-e2e/src/support/global-teardown.ts
Normal file
6
apps/server-e2e/src/support/global-teardown.ts
Normal file
@ -0,0 +1,6 @@
|
||||
/* eslint-disable */
|
||||
module.exports = async function () {
|
||||
// Put clean up logic here (e.g. stopping services, docker-compose, etc.).
|
||||
// Hint: `globalThis` is shared between setup and teardown.
|
||||
console.log(globalThis.__TEARDOWN_MESSAGE__);
|
||||
};
|
||||
8
apps/server-e2e/src/support/test-setup.ts
Normal file
8
apps/server-e2e/src/support/test-setup.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import axios from "axios";
|
||||
|
||||
module.exports = async function () {
|
||||
const serverUrl = process.env.VITE_SERVER_URL ?? "http://localhost:3000";
|
||||
|
||||
axios.defaults.withCredentials = true;
|
||||
axios.defaults.baseURL = `${serverUrl}/api`;
|
||||
};
|
||||
Reference in New Issue
Block a user