Cinema Tickets JavaScript App

This is a JavaScript application for purchasing cinema tickets. It provides functionality for calculating ticket prices, reserving seats, and processing payments.

Prerequisites

Before running the application, make sure you have the following prerequisites installed on your machine:

  • Node.js (version >= 16.15.1)

Installation

  1. Clone this repository to your local machine.
  2. Navigate to the project directory.
cd dwp-cinema-tickets
  1. Install the dependencies using npm.
npm install

Running the Application

To run the application and purchase cinema tickets, follow these steps:

  1. Open the app.js file located in the root directory.

  2. Customize the ticketTypeRequests array with the desired ticket types and quantities.

  3. Save the file.

  4. 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.

Running the Test Scripts

This project includes test scripts to ensure the correctness of the application's functionality. To run the test scripts, follow these steps:

  1. Ensure that you have completed the installation steps mentioned earlier.

  2. 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.