startercodeforcicdpipeline
Version:
This is my starter code for my TYPESCRIPT CI CD PIPELINE
19 lines (18 loc) • 807 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 - Borrow Book', () => {
it('should allow a customer to borrow a book if available', () => {
const bookstore = new Bookstore_1.Bookstore();
const book = new Book_1.Book(1, '1984', 'George Orwell', true);
const customer = new Customer_1.Customer(1, 'Alice');
bookstore.addBook(book);
bookstore.addCustomer(customer);
const result = bookstore.borrowBook(1, 1);
expect(result).toBe('Alice successfully borrowed "1984".');
expect(book.available).toBe(false);
expect(customer.borrowedBooks).toContain(1);
});
});