Run yarn
to install the dependencies
Run the API at http://localhost:3000
Set the following environnement variables in .env.development
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_SENTRY_ENV=development
VITE_SHOW_NOTIFICATIONS=true
VITE_H5P_INTEGRATION_URL=
Run yarn start
. The client should be accessible at http://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=false
Run yarn start:test
and yarn cypress:open
in 2 terminal windows.
:warning: It is possible that the websocket test become flacky (or just stop passing) if you use the dev server. In that case, you can resort to first building the app in test mode 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:
.env.test
file to pull env variables).env.test
file)You can disable opening the url on start by adding the following line to your .env.development
/.env.test
file:
BROWSER='none'