make unit tests runnable again
All checks were successful
ci / build (push) Successful in 1m8s

This commit is contained in:
Christopher Hase 2025-04-17 13:50:24 +02:00
parent 1d62a62f33
commit b61a166649
5 changed files with 11 additions and 12 deletions

View file

@ -32,14 +32,12 @@ The backend server has a separate ingress, so API requests can get forwarded to
The frontend server is running inside the pod on the address http://localhost:8080/iching. It provides an HTML homepage with a button. Upon pressing the button, the backend server will be called (to send an E-Mail). The frontend server is running inside the pod on the address http://localhost:8080/iching. It provides an HTML homepage with a button. Upon pressing the button, the backend server will be called (to send an E-Mail).
The frontend server has a separate ingress from the backend server, since the frontend server needs the 'rewrite target' annotation: So the Frontend is not running in the root folder but using the sub-path 'iching'. The frontend server has a separate ingress from the backend server, since the frontend server needs the 'rewrite target' annotation: So the Frontend is not running in the root folder but using the sub-path 'iching'.
<!--## Testing ## Testing
The Jest unit tests can be run with The Jest unit tests can be run with
```bash ```bash
$ npm test $ npm test
``` ```
-->
## Running the App ## Running the App

View file

@ -1,5 +1,5 @@
/*import { html } from "./broker"; import { html } from "./broker";
import { test } from "@jest/globals"; //import { test } from "@jest/globals";
jest.useFakeTimers(); jest.useFakeTimers();
@ -17,4 +17,3 @@ test("Generate HTML for images", () => {
expect(html("Images:\nOver the earth, the lake:\nThe image of Gathering Together.\nThus the superior man renews his weapons\nIn order to meet the unforseen.")) expect(html("Images:\nOver the earth, the lake:\nThe image of Gathering Together.\nThus the superior man renews his weapons\nIn order to meet the unforseen."))
.toBe("<p><h3>Images:</h3>Over the earth, the lake:<br>The image of Gathering Together.<br>Thus the superior man renews his weapons<br>In order to meet the unforseen.<br></p></div>"); .toBe("<p><h3>Images:</h3>Over the earth, the lake:<br>The image of Gathering Together.<br>Thus the superior man renews his weapons<br>In order to meet the unforseen.<br></p></div>");
}); });
*/

View file

@ -3,8 +3,7 @@
"version": "1.0.0", "version": "1.0.0",
"main": "broker.js", "main": "broker.js",
"scripts": { "scripts": {
"test": "jest --no-cache --force-exit", "test": "jest --no-cache --force-exit"
"start:local": "tsc -p tsconfig.backend.json && tsc -p tsconfig.frontend.json && DEPLOY_MODE=local node dist/backend/server.js & npx http-server dist/frontend -p 8080 --cors --mime application/javascript=js"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
@ -25,5 +24,9 @@
"express": "^5.1.0", "express": "^5.1.0",
"http-server": "^14.1.1", "http-server": "^14.1.1",
"nodemailer": "^6.10.0" "nodemailer": "^6.10.0"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node"
} }
} }

View file

@ -8,7 +8,6 @@
"esModuleInterop": true, "esModuleInterop": true,
"skipLibCheck": true "skipLibCheck": true
}, },
"include": [ "include": ["backend/**/*.ts"],
"backend/**/*.ts" "exclude": ["backend/**/*.test.ts"]
]
} }