Skip to content

Commit

Permalink
feat(gatsby-core-utils): improve fetch-remote-file (gatsbyjs#34758)
Browse files Browse the repository at this point in the history
* feat(gatsby-core-utils): improve fetch-remote-file

* feat: use cacheKey in fetch-remote-file

* use async file operations

* Improve tests + low hanging fruit

* revert wordpress

* feat: make sure 304 works

* fix jest config wordpress

* add integration test

* update tests
  • Loading branch information
wardpeet authored Feb 17, 2022
1 parent 8b68800 commit fa2277f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/create-remote-file-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jest.mock(`got`, () => {
}
})

jest.mock(`gatsby-core-utils`, () => {
jest.mock(`gatsby-core-utils/fetch-remote-file`, () => {
return {
fetchRemoteFile: jest.fn(),
}
Expand All @@ -37,7 +37,7 @@ const reporter = {}

const createRemoteFileNode = require(`../create-remote-file-node`)
const { createFileNode } = require(`../create-file-node`)
const { fetchRemoteFile } = require(`gatsby-core-utils`)
const { fetchRemoteFile } = require(`gatsby-core-utils/fetch-remote-file`)

const createMockCache = () => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/create-remote-file-node.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { fetchRemoteFile } = require(`gatsby-core-utils`)
const { fetchRemoteFile } = require(`gatsby-core-utils/fetch-remote-file`)
const { isWebUri } = require(`valid-url`)
const { createFileNode } = require(`./create-file-node`)

Expand Down

0 comments on commit fa2277f

Please sign in to comment.