Am having issues with the final describe block “Store purchase end-to-end test”

Am having issues with the final describe block “Store purchase end-to-end test”

const { expect } = require(“chai”);

const Customer = require(“../class/customer.js”);

const PremiumCustomer = require(“../class/premium-customer.js”);

const Store = require(“../class/store.js”);

const StoreItem = require(“../class/store-item.js”);

describe(“Customer”, function () {

it(“should set username on creation”, function () {

let customer = new Customer(“LeBron James”);

expect(customer.name).to.equal(“LeBron James”);

});

it(“should have money and purchases attributes”, function () {

let customer = new Customer(“LeBron James”);

expect(customer.money).to.equal(0);

expect(customer.purchases).to.deep.equal([]);

});

it(“should allow customers to add and withdraw funds”, function () {

let customer = new Customer(“LeBron James”);

customer.addFunds(10);

expect(customer.money).to.equal(10);

customer.withdrawFunds(3);

expect(customer.money).to.equal(7);

});

it(“should not allow customers to withdraw more funds than they own”, function () {

let customer = new Customer(“LeBron James”);

expect(customer.money).to.equal(0);

expect(customer.withdrawFunds.bind(customer, 5)).to.throw(Error);

});

});

Complete Answer:

Get Instant Help in Homework Asap
Get Instant Help in Homework Asap
Calculate your paper price
Pages (550 words)
Approximate price: -
Open chat
1
Hello 👋
Thank you for choosing our assignment help service!
How can I help you?