Skip to content

Commit

Permalink
[core] Close JSDOM window after schema is resolved (#2279)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Feb 2, 2021
1 parent 6f3ecba commit 3f87010
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/@sanity/core/src/actions/graphql/getSanitySchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function provideFakeGlobals() {

function getSanitySchema(basePath) {
const domCleanup = jsdomGlobal()
const windowCleanup = () => global.window.close()
const globalCleanup = provideFakeGlobals()
const contextCleanup = requireContext.register()
const cleanupFileLoader = pirates.addHook(
Expand All @@ -49,6 +50,7 @@ function getSanitySchema(basePath) {
cleanupFileLoader()
contextCleanup()
globalCleanup()
windowCleanup()
domCleanup()

return schema
Expand Down

2 comments on commit 3f87010

@vercel
Copy link

@vercel vercel bot commented on 3f87010 Feb 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

perf-studio – ./

perf-studio-git-next.sanity.build
perf-studio.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 3f87010 Feb 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

test-studio – ./

test-studio.sanity.build
test-studio.now.sh
test-studio-git-next.sanity.build

Please sign in to comment.