startercodeforcicdpipeline
Version:
This is my starter code for my TYPESCRIPT CI CD PIPELINE
20 lines (19 loc) • 869 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const Book_1 = require("../Book");
const Customer_1 = require("../Customer");
const Bookstore_1 = require("../Bookstore");
describe('Bookstore - Return Book', () => {
it('should allow a customer to return a borrowed book', () => {
const bookstore = new Bookstore_1.Bookstore();
const book = new Book_1.Book(1, 'To Kill a Mockingbird', 'Harper Lee', true);
const customer = new Customer_1.Customer(1, 'Bob');
bookstore.addBook(book);
bookstore.addCustomer(customer);
bookstore.borrowBook(1, 1);
const result = bookstore.returnBook(1, 1);
expect(result).toBe('Bob successfully returned "To Kill a Mockingbird".');
expect(book.available).toBe(true);
expect(customer.borrowedBooks).not.toContain(1);
});
});