Skip to content
Snippets Groups Projects
Select Git revision
  • main
  • dev default protected
  • feat/snap-scroll
  • feat/landing-page
  • test/househouldCypress
  • test/cypressCoverage
  • test/editProfileVitest
  • test/shopping-list
  • feat/theming
  • feat/store_advertisements
  • feat/register-vitest
  • refac/navigation-window-component
  • logregtest
  • feat/login-page
  • sprint-1
15 results

smartmat-frontend

user avatar
Arunan Gnanasekaran authored
d71cdfc0
History

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

Run Unit Tests with Vitest

npm run test:unit

Run End-to-End Tests with Cypress

npm 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

Lint with ESLint

npm 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