Warning
This Project has been archived. You can find all the up-to-date code in https://github.com/graasp/client
This was archived on Nov 28 2024.
-
Run
yarnto install the dependencies -
Run the API at
http://localhost:3000 -
Set the following environnement variables in
.env.developmentVITE_PORT=3112 VITE_GRAASP_API_HOST=http://localhost:3000 VITE_GRAASP_AUTH_HOST=http://localhost:3001 VITE_GRAASP_BUILDER_HOST=http://localhost:3111 VITE_GRAASP_LIBRARY_HOST=http://localhost:3005 VITE_GRAASP_ANALYTICS_HOST=http://localhost:3113 VITE_SENTRY_ENV=development VITE_SHOW_NOTIFICATIONS=true VITE_H5P_INTEGRATION_URL=
-
Run
yarn start. The client should be accessible athttp://localhost:3112
The tests are run using Cypress. Cypress only compiles the code for the tests, your app needs to run at the specified baseUrl (for tests this defaults to http://localhost:3112).
Set the following environnement variables in .env.test
VITE_PORT=3112
VITE_GRAASP_API_HOST=http://localhost:3000
VITE_GRAASP_AUTH_HOST=http://localhost:3001
VITE_GRAASP_BUILDER_HOST=http://localhost:3111
VITE_GRAASP_LIBRARY_HOST=http://localhost:3005
VITE_GRAASP_ANALYTICS_HOST=http://localhost:3113
VITE_H5P_INTEGRATION_URL=
VITE_SHOW_NOTIFICATIONS=falseRun yarn start:test and yarn cypress:open in 2 terminal windows.
yarn build:test and then starting a preview of the app with yarn preview:test.
You will need to have the .env.test file from the other section.
You can simply run: yarn test. This will:
- Build your app in test mode (using the
.env.testfile to pull env variables) - Start your app in preview mode (simply serve the generated files with a static http server, but using the same
.env.testfile) - Start the cypress tests to run your full test suite (this can take a while depending on the number of tests you have)
You can disable opening the url on start by adding the following line to your .env.development/.env.test file:
BROWSER='none'