smartmat-frontend
Project Setup
npm install
Compile and Hot-Reload for Development
npm run dev
Type-Check, Compile and Minify for Production
npm run build
Vitest
Run Unit Tests withnpm run test:unit
Cypress
Run End-to-End Tests withnpm run test:e2e:dev
This runs the end-to-end tests against the Vite development server. It is much faster than the production build.
But it's still recommended to test the production build with test:e2e
before deploying (e.g. in CI environments):
npm run build
npm run test:e2e
ESLint
Lint withnpm run lint
Contributing
Setup
The frontend is formatted with Prettier, and linted with ESLint. To ensure correct formatting and linting, you should add the pre-commit file (found in the root of this repository) to your .git/hooks/ folder after cloning this repository.
Mocking an api
To mock the api, you may use the prism. To install prism, run the following command:
npm install -g @stoplight/prism-cli
Prism needs a swagger file to mock the api. This can be found in the backend repository.
To start the mock server, run:
prism mock swagger.yaml