-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtoCSVArray.test.js
More file actions
44 lines (41 loc) · 846 Bytes
/
toCSVArray.test.js
File metadata and controls
44 lines (41 loc) · 846 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
39
40
41
42
43
44
const toCSVArray = require("../src/toCSVArray");
const nestedTestData = [
{
id: 1,
name: "Alice",
age: 25,
hobbies: ["reading", "painting"],
addresses: [
{
type: "home",
street: "123 Main St",
city: "Exampleville",
},
{
type: "work",
street: "456 Office Rd",
city: "Workington",
},
],
},
{
id: 2,
name: "Bob",
age: 30,
hobbies: ["gardening", "cooking"],
addresses: [
{
type: "home",
street: "789 Garden Ave",
city: "Greenville",
},
],
},
];
console.log(JSON.stringify(nestedTestData))
describe("toCSVArray", () => {
test("toCSVArray ", () => {
expect(toCSVArray(nestedTestData)).toMatchSnapshot();
expect(toCSVArray(nestedTestData, false)).toMatchSnapshot();
});
});