Skip to content

Commit

Permalink
add nested arrays in array of objects to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pieh committed Feb 20, 2018
1 parent c6b6a83 commit ee447d2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ Object {
"name": Object {
"field": "name",
},
"nestedArrays": Object {
"field": "nestedArrays",
},
"objectsInArray": Object {
"field": "objectsInArray",
},
}
`;

Expand All @@ -61,5 +67,17 @@ Object {
"iAmNull": null,
"key-with..unsupported-values": true,
"name": "The Mad Max",
"nestedArrays": Array [
Array [
1,
],
],
"objectsInArray": Array [
Object {
"field1": true,
"field2": 1,
"field3": "foo",
},
],
}
`;
4 changes: 4 additions & 0 deletions packages/gatsby/src/schema/__tests__/data-tree-utils-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ describe(`Gatsby data tree utils`, () => {
"key-with..unsupported-values": true,
emptyArray: [],
anArray: [1, 2, 3, 4],
nestedArrays: [[1, 2, 3], [4, 5, 6]],
objectsInArray: [{ field1: true }, { field2: 1 }],
frontmatter: {
date: `2006-07-22T22:39:53.000Z`,
title: `The world of dash and adventure`,
Expand All @@ -29,6 +31,8 @@ describe(`Gatsby data tree utils`, () => {
emptyArray: [undefined, null],
anArray: [1, 2, 5, 4],
iAmNull: null,
nestedArrays: [[1, 2, 3]],
objectsInArray: [{ field3: `foo` }],
frontmatter: {
date: `2006-07-22T22:39:53.000Z`,
title: `The world of slash and adventure`,
Expand Down

0 comments on commit ee447d2

Please sign in to comment.