-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibraryBookTest.js
More file actions
38 lines (27 loc) · 998 Bytes
/
libraryBookTest.js
File metadata and controls
38 lines (27 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"use strict";
const assert = require("assert");
const myExports = require("./app.js");
const title = myExports.title;
const author= myExports.author;
const libraryId = myExports.libraryId;
const addBook= myExports. addBook;
describe("library", function () {
const titles = ['Harry poter','FiftyShadesOfGray', "The Road Ahead", "TheRingOfTheYear",];
const authors = ['fili', 'miki', 'luwam'];
const ids = [510, 222, 121];
it("find titles", function () {
assert.deepEqual( title(), titles);
});
it("find authors", function () {
assert.deepEqual(author(), authors);
});
it("find ids", function () {
assert.deepEqual(libraryId(), ids);
});
it("add book", function () {
const newBook = {title: "My brand new Book", author: "Me ", libraryID: 1145};
ids.unshift(1144);
assert.deepEqual( addBook("My brand newBook", "Me ", 1145), newBook);
assert.deepEqual(libraryId(), ids);
});
});