mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-14 00:32:35 +10:00
refactor(v4.0.0-alpha): beginning of a new era
This commit is contained in:
18
apps/server-e2e/.eslintrc.json
Normal file
18
apps/server-e2e/.eslintrc.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"extends": ["../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.ts", "*.tsx"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.js", "*.jsx"],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
19
apps/server-e2e/jest.config.ts
Normal file
19
apps/server-e2e/jest.config.ts
Normal file
@ -0,0 +1,19 @@
|
||||
/* eslint-disable */
|
||||
export default {
|
||||
displayName: "server-e2e",
|
||||
preset: "../../jest.preset.js",
|
||||
globalSetup: "<rootDir>/src/support/global-setup.ts",
|
||||
globalTeardown: "<rootDir>/src/support/global-teardown.ts",
|
||||
setupFiles: ["<rootDir>/src/support/test-setup.ts"],
|
||||
testEnvironment: "node",
|
||||
transform: {
|
||||
"^.+\\.[tj]s$": [
|
||||
"ts-jest",
|
||||
{
|
||||
tsconfig: "<rootDir>/tsconfig.spec.json",
|
||||
},
|
||||
],
|
||||
},
|
||||
moduleFileExtensions: ["ts", "js", "html"],
|
||||
coverageDirectory: "../../coverage/server-e2e",
|
||||
};
|
||||
24
apps/server-e2e/project.json
Normal file
24
apps/server-e2e/project.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "server-e2e",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"e2e": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/{e2eProjectRoot}"],
|
||||
"options": {
|
||||
"jestConfig": "apps/server-e2e/jest.config.ts",
|
||||
"passWithNoTests": true
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": ["apps/server-e2e/**/*.{js,ts}"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": ["backend"],
|
||||
"implicitDependencies": ["server"]
|
||||
}
|
||||
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`;
|
||||
};
|
||||
13
apps/server-e2e/tsconfig.json
Normal file
13
apps/server-e2e/tsconfig.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.spec.json"
|
||||
}
|
||||
],
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
||||
9
apps/server-e2e/tsconfig.spec.json
Normal file
9
apps/server-e2e/tsconfig.spec.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": ["jest.config.ts", "src/**/*.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user