Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Swap http-server for a custom server with express (front-end integration tests) #4519

Merged
merged 1 commit into from Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/package.json
Expand Up @@ -30,7 +30,7 @@
"translations:find-unused": "node ./scripts/find-unused-translations.js",
"compile": "node ./scripts/compile.js",
"watch": "node ./scripts/watch.js",
"e2e:server": "NODE_NO_WARNINGS=1 http-server ./resources/public -p 3500 -a 0.0.0.0",
"e2e:server": "node ./scripts/e2e-server.js",
"e2e:test": "playwright test",
"storybook:compile": "gulp template:storybook && clojure -M:dev:shadow-cljs compile storybook",
"storybook:watch": "npm run storybook:compile && concurrently \"clojure -M:dev:shadow-cljs watch storybook\" \"storybook dev -p 6006\"",
Expand All @@ -51,6 +51,7 @@
"autoprefixer": "^10.4.17",
"concurrently": "^8.2.2",
"draft-js": "git+https://github.com/penpot/draft-js.git",
"express": "^4.19.2",
"fancy-log": "^2.0.0",
"gettext-parser": "^8.0.0",
"gulp": "4.0.2",
Expand All @@ -62,7 +63,6 @@
"gulp-sass": "^5.1.0",
"gulp-sourcemaps": "^3.0.0",
"gulp-svg-sprite": "^2.0.3",
"http-server": "^14.1.1",
"jsdom": "^24.0.0",
"map-stream": "0.0.7",
"marked": "^12.0.0",
Expand Down
13 changes: 13 additions & 0 deletions frontend/scripts/e2e-server.js
@@ -0,0 +1,13 @@
import express from "express";
import { fileURLToPath } from "url";
import path from "path";

const app = express();
const port = 3500;

const staticPath = path.join(fileURLToPath(import.meta.url), "../../resources/public");
app.use(express.static(staticPath));

app.listen(port, () => {
console.log(`Listening at 0.0.0.0:${port}`);
});