Skip to content

Commit 629b30f

Browse files
gatsbybotFoo-x
andauthored
fix(gatsby-plugin-preload-fonts): disable cache (#34633) (#35790)
* fix(gatsby-plugin-preload-fonts): disable cache Closes #34632 * fix(gatsby-plugin-preload-fonts): add func to mock Co-authored-by: Ward Peeters <[email protected]> Co-authored-by: Kyle Mathews <[email protected]> (cherry picked from commit e7db715) Co-authored-by: Foo-x <[email protected]>
1 parent ae95d66 commit 629b30f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/gatsby-plugin-preload-fonts/src/__tests__/index.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const mockPageRequests = requests => {
4949
}
5050
},
5151
url: () => currentPath,
52+
setCacheEnabled: () => {},
5253
}
5354

5455
return { close: jest.fn(), newPage: () => Promise.resolve(page) }

packages/gatsby-plugin-preload-fonts/src/prepare/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export async function main() {
6060

6161
const browser = await puppeteer.launch({ args: process.argv.slice(2) })
6262
const page = await browser.newPage()
63+
page.setCacheEnabled(false)
6364
page.on(`requestfinished`, req => {
6465
if (req.url().match(/(socket\.io|commons\.js)/)) return
6566

0 commit comments

Comments
 (0)