-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformat.test.js
More file actions
13 lines (11 loc) · 755 Bytes
/
Copy pathformat.test.js
File metadata and controls
13 lines (11 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
const format = require("./format");
const data = "Publication Date,Title,Authors\n29/07/1954,Lord of the Rings,John Ronald Reuel Tolkien\n01/08/1996,A Game of Thrones,George Raymond Martin\n05/07/2022,Tomorrow and Tomorrow and Tomorrow,Gabrielle Zevin";
test('correctly formats data', () => {
expect(format(data)).toEqual([
"| Pub Date | Title | Authors |",
"|=====================================================================|",
"| 29 Jul 1954 | Lord of the Rings | John Ronald Reuel ... |",
"| 01 Aug 1996 | A Game of Thrones | George Raymond Martin |",
"| 05 Jul 2022 | Tomorrow and Tomorrow and ... | Gabrielle Zevin |"
])
})