The Counter component is a simple React component that allows you to display a count value and perform basic count manipulation operations.
Before using the Counter component, make sure you have the following prerequisites installed:
- Node.js: >= 16.0.0
- npm: >= 7.0.0
- Clone the repository.
- Install dependencies by running the following command:
npm install
To start the development server, run the following command:
npm run dev
The application will be accessible at http://localhost:3000.
To start the Production server, run the following command:
npm run build
then run
npm start
This script starts the built production version of your Next.js application. When you run npm start, Next.js starts a server to serve the previously built production assets. This script is typically used in a production environment to serve your application to users.
The application will be accessible at http://localhost:3000.
The Counter component does not accept any props.
To test the functionality of the Counter component use the following command
npm run cypress
All test instructions are inside the app.cy.js
file as comments. Here you can see the main E2E test cases instructions
describe("Counter", () => {
beforeEach(() => {
cy.visit("http://localhost:3000");
});
it("should increase the count by 10 and display toast message", () => {
// Test code here...
});
it("should reset the count to 0", () => {
// Test code here...
});
it("should decrease the count by 10 and display toast message", () => {
// Test code here...
});
});