refactor(v4.0.0-alpha): beginning of a new era

This commit is contained in:
Amruth Pillai
2023-11-05 12:31:42 +01:00
parent 0ba6a444e2
commit 22933bd412
505 changed files with 81829 additions and 0 deletions

View 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" });
});
});

View 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";
};

View 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__);
};

View 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`;
};