From 992b0f86346556f632a4c639c9026413a02e4a77 Mon Sep 17 00:00:00 2001 From: hector Date: Mon, 6 Nov 2023 15:48:03 -0500 Subject: [PATCH] created first test --- classes/Product.js | 15 +++++++++++++++ index.js | 5 +++-- package-lock.json | 3 ++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/classes/Product.js b/classes/Product.js index e69de29..b6c13de 100644 --- a/classes/Product.js +++ b/classes/Product.js @@ -0,0 +1,15 @@ +class Product { + + constructor(name, price, description){ + this.name = name; + this.price = price; + this.description = description; + this.inStock = true; + } + + display(){ + return `Name: ${this.name}, Price: $${this.price}, Description: ${this.description}` + } +} + +module.exports = Product; diff --git a/index.js b/index.js index efad601..a98e822 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,8 @@ // Import Classes Here +const Product = require("./classes/Product.js") - - +const carrots = new Product("Carrots", 4, "Bushel of carrots that have been freshly harvested for you"); +console.log(carrots); diff --git a/package-lock.json b/package-lock.json index 9b68881..5713249 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4717,7 +4717,8 @@ "jest-pnp-resolver": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", - "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==" + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "requires": {} }, "jest-regex-util": { "version": "29.4.3",