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

[NO-MERGE] Enhancing createContentDigest tests -- requesting help #9072

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Array [
"funny": "yup",
"id": "uuid-from-gatsby",
"internal": Object {
"contentDigest": "contentDigest",
"contentDigest": "5005aee6b2557974cae0aabc712e125a",
"type": "TestCsv",
},
"parent": "whatever",
Expand All @@ -22,7 +22,7 @@ Array [
"funny": "nope",
"id": "uuid-from-gatsby",
"internal": Object {
"contentDigest": "contentDigest",
"contentDigest": "0af87da7e572c2d6d8493bcd642c2c78",
"type": "TestCsv",
},
"parent": "whatever",
Expand All @@ -41,7 +41,7 @@ Array [
"funny": "yup",
"id": "uuid-from-gatsby",
"internal": Object {
"contentDigest": "contentDigest",
"contentDigest": "5005aee6b2557974cae0aabc712e125a",
"type": "TestCsv",
},
"parent": "whatever",
Expand Down Expand Up @@ -70,7 +70,7 @@ false,\\"nope\\"",
"funny": "nope",
"id": "uuid-from-gatsby",
"internal": Object {
"contentDigest": "contentDigest",
"contentDigest": "0af87da7e572c2d6d8493bcd642c2c78",
"type": "TestCsv",
},
"parent": "whatever",
Expand Down Expand Up @@ -103,7 +103,7 @@ Array [
"field2": "funny",
"id": "uuid-from-gatsby",
"internal": Object {
"contentDigest": "contentDigest",
"contentDigest": "49605f5e32a2250d7ca740c5d2e79784",
"type": "TestCsv",
},
"parent": "whatever",
Expand All @@ -116,7 +116,7 @@ Array [
"field2": "yup",
"id": "uuid-from-gatsby",
"internal": Object {
"contentDigest": "contentDigest",
"contentDigest": "2bf0bc0e8539ef5f6bbcf67c8b733233",
"type": "TestCsv",
},
"parent": "whatever",
Expand All @@ -129,7 +129,7 @@ Array [
"field2": "nope",
"id": "uuid-from-gatsby",
"internal": Object {
"contentDigest": "contentDigest",
"contentDigest": "f5f617ce4243d639de924543dec5600e",
"type": "TestCsv",
},
"parent": "whatever",
Expand All @@ -148,7 +148,7 @@ Array [
"field2": "funny",
"id": "uuid-from-gatsby",
"internal": Object {
"contentDigest": "contentDigest",
"contentDigest": "49605f5e32a2250d7ca740c5d2e79784",
"type": "TestCsv",
},
"parent": "whatever",
Expand Down Expand Up @@ -177,7 +177,7 @@ false,nope",
"field2": "yup",
"id": "uuid-from-gatsby",
"internal": Object {
"contentDigest": "contentDigest",
"contentDigest": "2bf0bc0e8539ef5f6bbcf67c8b733233",
"type": "TestCsv",
},
"parent": "whatever",
Expand Down Expand Up @@ -206,7 +206,7 @@ false,nope",
"field2": "nope",
"id": "uuid-from-gatsby",
"internal": Object {
"contentDigest": "contentDigest",
"contentDigest": "f5f617ce4243d639de924543dec5600e",
"type": "TestCsv",
},
"parent": "whatever",
Expand Down
3 changes: 1 addition & 2 deletions packages/gatsby-transformer-csv/src/__tests__/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const Promise = require(`bluebird`)
const json2csv = require(`json2csv`)

const createContentDigest = require(`../../../gatsby/src/utils/create-content-digest`)
const { onCreateNode } = require(`../gatsby-node`)

describe(`Process nodes correctly`, () => {
Expand Down Expand Up @@ -30,7 +31,6 @@ describe(`Process nodes correctly`, () => {
const actions = { createNode, createParentChildLink }
const createNodeId = jest.fn()
createNodeId.mockReturnValue(`uuid-from-gatsby`)
const createContentDigest = jest.fn().mockReturnValue(`contentDigest`)

await onCreateNode({
node,
Expand All @@ -54,7 +54,6 @@ describe(`Process nodes correctly`, () => {
const actions = { createNode, createParentChildLink }
const createNodeId = jest.fn()
createNodeId.mockReturnValue(`uuid-from-gatsby`)
const createContentDigest = jest.fn().mockReturnValue(`contentDigest`)

await onCreateNode(
{
Expand Down