mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
parent
a0d2caf003
commit
201236195d
@ -1,5 +1,6 @@
|
|||||||
import { resolve } from 'path'
|
import { resolve } from 'path'
|
||||||
import { promises as fsp } from 'fs'
|
import { promises as fsp } from 'fs'
|
||||||
|
import { TextEncoder, TextDecoder } from 'util'
|
||||||
import { JSDOM } from 'jsdom'
|
import { JSDOM } from 'jsdom'
|
||||||
|
|
||||||
import { setupTest, testNitroBehavior } from './_tests.mjs'
|
import { setupTest, testNitroBehavior } from './_tests.mjs'
|
||||||
@ -42,12 +43,18 @@ describe('nitro:preset:cloudflare', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script>${script}</script>
|
<script>window._load = function() { ${script} }</script>
|
||||||
</body>
|
</body>
|
||||||
</html>`,
|
</html>`,
|
||||||
{ runScripts: 'dangerously' }
|
{ runScripts: 'dangerously' }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// https://github.com/jsdom/jsdom/issues/2524
|
||||||
|
// https://github.com/inrupt/solid-client-authn-js/issues/1676#issuecomment-917016646
|
||||||
|
dom.window.TextEncoder = TextEncoder
|
||||||
|
dom.window.TextDecoder = TextDecoder
|
||||||
|
dom.window._load()
|
||||||
|
|
||||||
return async ({ url, headers, method, body }) => {
|
return async ({ url, headers, method, body }) => {
|
||||||
const data = await dom.window.handleEvent({
|
const data = await dom.window.handleEvent({
|
||||||
request: {
|
request: {
|
||||||
|
Loading…
Reference in New Issue
Block a user