Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialize date objects in markdown frontmatter to avoid type mismatches when inferring GraphQL types #2163

Merged
merged 2 commits into from
Sep 18, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix test
  • Loading branch information
KyleAMathews committed Sep 18, 2017
commit 83d7ab6144a40e66fa50aeb41bcf902d726d66d3
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ Array [
"child": Object {
"children": Array [],
"frontmatter": Object {
"date": "12/12/2014",
"date": "2017-09-18T23:19:51.246Z",
"parent": "whatever",
"title": "my little pony",
},
"id": "whatever >>> MarkdownRemark",
"internal": Object {
"content": "---
title: \\"my little pony\\"
date: \\"12/12/2014\\"
date: \\"2017-09-18T23:19:51.246Z\\"
---

Where oh where is my little pony?
",
"contentDigest": "54cfa2ad99756f2fa232cac585280a37",
"contentDigest": "1235e2d6fdcadd5f09bf4c221bdf9094",
"type": "MarkdownRemark",
},
"parent": "whatever",
Expand All @@ -57,7 +57,7 @@ Where oh where is my little pony?
"children": Array [],
"content": "---
title: \\"my little pony\\"
date: \\"12/12/2014\\"
date: \\"2017-09-18T23:19:51.246Z\\"
---

Where oh where is my little pony?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ Where oh where is my little pony?
boundActionCreators,
}).then(() => {
expect(createNode.mock.calls).toMatchSnapshot()
expect(_.isString(createNode.mock.calls[0].frontmatter.date)).toBeTruthy()
expect(
_.isString(createNode.mock.calls[0][0].frontmatter.date)
).toBeTruthy()
expect(createParentChildLink.mock.calls).toMatchSnapshot()
expect(createNode).toHaveBeenCalledTimes(1)
expect(createParentChildLink).toHaveBeenCalledTimes(1)
Expand Down