This is a JavaScript application for purchasing cinema tickets. It provides functionality for calculating ticket prices, reserving seats, and processing payments.
Before running the application, make sure you have the following prerequisites installed on your machine:
- Node.js (version >= 16.15.1)
- Clone this repository to your local machine.
- Navigate to the project directory.
cd dwp-cinema-tickets
- Install the dependencies using npm.
npm install
To run the application and purchase cinema tickets, follow these steps:
-
Open the
app.js
file located in the root directory. -
Customize the
ticketTypeRequests
array with the desired ticket types and quantities. -
Save the file.
-
Run the application using the following command:
node app.js
The application will execute and display the response, which includes the amount paid, number of seats reserved, and ticket details.
This project includes test scripts to ensure the correctness of the application's functionality. To run the test scripts, follow these steps:
-
Ensure that you have completed the installation steps mentioned earlier.
-
Run the following command to execute the test scripts:
npm test
The test runner will execute the test suite and display the test results, including any failures or errors.