This guide provides step-by-step instructions to set up, run, and test the TriangleFrontend project on your local machine.
Before proceeding, ensure you have the following installed on your system:
- Node.js (LTS version recommended)
- npm (comes with Node.js)
- Angular CLI (install globally using
npm install -g @angular/cli)
-
Navigate to the Project Directory
Open a terminal and navigate to the
triangle-frontenddirectory:cd triangle-frontendThis step ensures you are in the correct directory where the project files are located.
-
Install Dependencies
Run the following command to install all required dependencies:
npm install
This step is crucial because it downloads and installs all the libraries and packages specified in the package.json file. These dependencies are required for the project to build and run correctly.
-
Start the Development Server
Start the Angular development server by running:
ng serve
This command compiles the project and starts a local development server. Once the server is running, open your browser and navigate to http://localhost:4200/ to view the application. The server will automatically reload when you make changes to the source files.
-
Navigate to the Project Directory
Ensure you are in the triangle-frontend directory:
-
Run Unit Tests
Execute the following command to run the unit tests:
ng testThis command uses the Karma test runner to execute the unit tests defined in the project. The results will be displayed in the terminal, and a browser window may open to show detailed test results.
To run the test once and in headless mode (without opening a browser), you can use the following command:
ng test --watch=false --browsers=ChromeHeadless