-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
186 additions
and
14 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
packages/astro/test/fixtures/react-component/src/components/LazyComponent.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react'; | ||
|
||
export const LazyComponent = () => { | ||
return ( | ||
<span id="lazy">inner content</span> | ||
); | ||
}; | ||
|
||
export default LazyComponent; |
14 changes: 14 additions & 0 deletions
14
packages/astro/test/fixtures/react-component/src/components/Suspense.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React, { Suspense } from 'react'; | ||
const LazyComponent = React.lazy(() => import('./LazyComponent.jsx')); | ||
|
||
export const ParentComponent = () => { | ||
return ( | ||
<div id="outer"> | ||
<Suspense> | ||
<LazyComponent /> | ||
</Suspense> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ParentComponent; |
17 changes: 17 additions & 0 deletions
17
packages/astro/test/fixtures/react-component/src/pages/suspense.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
import Suspense from '../components/Suspense.jsx'; | ||
--- | ||
|
||
<html> | ||
<head> | ||
<!-- Head Stuff --> | ||
</head> | ||
<body> | ||
<div id="client"> | ||
<Suspense client:load /> | ||
</div> | ||
<div id="server"> | ||
<Suspense /> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/integrations/deno/test/fixtures/basics/astro.config.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/integrations/deno/test/fixtures/basics/src/components/React.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
export default function() { | ||
return ( | ||
<div id="react">testing</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// @ts-nocheck | ||
export { fromFileUrl } from 'https://deno.land/std@0.110.0/path/mod.ts'; | ||
export { assertEquals, assert } from 'https://deno.land/std@0.132.0/testing/asserts.ts'; | ||
export * from 'https://deno.land/x/deno_dom/deno-dom-wasm.ts'; |
9 changes: 7 additions & 2 deletions
9
packages/integrations/netlify/test/edge-functions/edge-basic.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
// @ts-ignore | ||
import { runBuild } from './test-utils.ts'; | ||
// @ts-ignore | ||
import { assertEquals, assert } from './deps.ts'; | ||
import { assertEquals, assert, DOMParser } from './deps.ts'; | ||
|
||
// @ts-ignore | ||
Deno.test({ | ||
name: 'Edge Basics', | ||
async fn() { | ||
let close = await runBuild('./fixtures/edge-basic/'); | ||
const { default: handler } = await import( | ||
'./fixtures/edge-basic/dist/edge-functions/entry.mjs' | ||
'./fixtures/edge-basic/dist/edge-functions/entry.js' | ||
); | ||
const response = await handler(new Request('http://example.com/')); | ||
assertEquals(response.status, 200); | ||
const html = await response.text(); | ||
assert(html, 'got some html'); | ||
|
||
const doc = new DOMParser().parseFromString(html, `text/html`)!; | ||
const div = doc.querySelector('#react'); | ||
assert(div, 'div exists'); | ||
|
||
await close(); | ||
}, | ||
}); |
13 changes: 13 additions & 0 deletions
13
...ons/netlify/test/edge-functions/fixtures/edge-basic/.netlify/edge-functions/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"functions": [ | ||
{ | ||
"function": "entry", | ||
"path": "/" | ||
}, | ||
{ | ||
"function": "entry", | ||
"path": "/two" | ||
} | ||
], | ||
"version": 1 | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/integrations/netlify/test/edge-functions/fixtures/edge-basic/astro.config.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...ges/integrations/netlify/test/edge-functions/fixtures/edge-basic/src/components/React.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
export default function() { | ||
return ( | ||
<div id="react">testing</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.