Skip to content

Commit

Permalink
Setup client deployment (#48)
Browse files Browse the repository at this point in the history
* Setup client deployment

* Fix $app/env.js reference in Jest tests

* Address feedback

* Fix API proxy forwarding

* Revert "Fix API proxy forwarding"

This reverts commit 37bdb82.

* Post merge udpate

* Win battle with Vitest

* Cleanup

* Fix Cypress request interception

* Cleanup

* Run client Supervisor process as foreground node
  • Loading branch information
florimondmanca committed Feb 7, 2022
1 parent a2edb1b commit 99b4753
Show file tree
Hide file tree
Showing 29 changed files with 5,307 additions and 8,981 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ install-server: #- Install server dependencies
install-client: #- Install client dependencies
cd client && npm ci

build: #- Build production assets
cd client && npm run build

serve: #- Serve both the server and the client in parallel
make -j 2 serve-server serve-client

Expand All @@ -26,6 +29,12 @@ serve-server: #- Run API server
serve-client: #- Run the client
./tools/colorize_prefix.sh [client] 33 "cd client && npm run dev"

serve-dist: #- Serve both the server and the built client in parallel
make -j 2 serve-server serve-dist-client

serve-dist-client: #- Run the built client
./tools/colorize_prefix.sh [client] 33 "cd client && npm start"

migrate: #- Apply pending migrations
${bin}alembic upgrade head

Expand Down
4 changes: 1 addition & 3 deletions client/cypress/integration/home_spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const server = "http://127.0.0.1:3579";

describe("Basic form submission", () => {
it("Visits the home page", () => {
const title = "Un nom de jeu de données";
Expand All @@ -9,7 +7,7 @@ describe("Basic form submission", () => {
cy.get("#title").type(title).should("have.value", title);
cy.get("#description").type(description).should("have.value", description);

cy.intercept("POST", `${server}/datasets/`).as("new-dataset");
cy.intercept("POST", `/api/datasets/`).as("new-dataset");
cy.get("button").click().contains("loading...");
cy.wait("@new-dataset").should(({ request, response }) => {
expect(request.method).to.equal("POST");
Expand Down

0 comments on commit 99b4753

Please sign in to comment.