-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): add mdx + framework tests
- Loading branch information
1 parent
6126074
commit 3586d13
Showing
19 changed files
with
179 additions
and
11 deletions.
There are no files selected for viewing
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,7 +1,8 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import preact from '@astrojs/preact'; | ||
import mdx from '@astrojs/mdx'; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [preact()], | ||
integrations: [preact(), mdx()], | ||
}); |
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
29 changes: 29 additions & 0 deletions
29
packages/astro/e2e/fixtures/preact-component/src/pages/mdx.mdx
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,29 @@ | ||
|
||
import Counter from '../components/Counter.jsx'; | ||
import PreactComponent from '../components/JSXComponent.jsx'; | ||
|
||
export const someProps = { | ||
count: 0, | ||
}; | ||
|
||
<Counter id="server-only" {...someProps}> | ||
# Hello, server! | ||
</Counter> | ||
|
||
<Counter id="client-idle" {...someProps} client:idle> | ||
# Hello, client:idle! | ||
</Counter> | ||
|
||
<Counter id="client-load" {...someProps} client:load> | ||
# Hello, client:load! | ||
</Counter> | ||
|
||
<Counter id="client-visible" {...someProps} client:visible> | ||
# Hello, client:visible! | ||
</Counter> | ||
|
||
<Counter id="client-media" {...someProps} client:media="(max-width: 50em)"> | ||
# Hello, client:media! | ||
</Counter> | ||
|
||
<PreactComponent id="client-only" client:only="preact" /> |
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,7 +1,8 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import react from '@astrojs/react'; | ||
import mdx from '@astrojs/mdx'; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [react()], | ||
integrations: [react(), mdx()], | ||
}); |
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
28 changes: 28 additions & 0 deletions
28
packages/astro/e2e/fixtures/react-component/src/pages/mdx.mdx
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,28 @@ | ||
import Counter from '../components/Counter.jsx'; | ||
import ReactComponent from '../components/JSXComponent.jsx'; | ||
|
||
export const someProps = { | ||
count: 0, | ||
}; | ||
|
||
<Counter id="server-only" {...someProps}> | ||
# Hello, server! | ||
</Counter> | ||
|
||
<Counter id="client-idle" {...someProps} client:idle> | ||
# Hello, client:idle! | ||
</Counter> | ||
|
||
<Counter id="client-load" {...someProps} client:load> | ||
# Hello, client:load! | ||
</Counter> | ||
|
||
<Counter id="client-visible" {...someProps} client:visible> | ||
# Hello, client:visible! | ||
</Counter> | ||
|
||
<Counter id="client-media" {...someProps} client:media="(max-width: 50em)"> | ||
# Hello, client:media! | ||
</Counter> | ||
|
||
<ReactComponent id="client-only" client:only="react" /> |
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,7 +1,8 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import mdx from '@astrojs/mdx'; | ||
import solid from '@astrojs/solid-js'; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [solid()], | ||
integrations: [solid(), mdx()], | ||
}); |
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
28 changes: 28 additions & 0 deletions
28
packages/astro/e2e/fixtures/solid-component/src/pages/mdx.mdx
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,28 @@ | ||
import Counter from '../components/Counter.jsx'; | ||
import SolidComponent from '../components/SolidComponent.jsx'; | ||
|
||
export const someProps = { | ||
count: 0, | ||
}; | ||
|
||
<Counter id="server-only" {...someProps}> | ||
# Hello, server! | ||
</Counter> | ||
|
||
<Counter id="client-idle" {...someProps} client:idle> | ||
# Hello, client:idle! | ||
</Counter> | ||
|
||
<Counter id="client-load" {...someProps} client:load> | ||
# Hello, client:load! | ||
</Counter> | ||
|
||
<Counter id="client-visible" {...someProps} client:visible> | ||
# Hello, client:visible! | ||
</Counter> | ||
|
||
<Counter id="client-media" {...someProps} client:media="(max-width: 50em)"> | ||
# Hello, client:media! | ||
</Counter> | ||
|
||
<SolidComponent id="client-only" client:only="solid" /> |
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,7 +1,8 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import svelte from '@astrojs/svelte'; | ||
import mdx from '@astrojs/mdx'; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [svelte()], | ||
integrations: [svelte(), mdx()], | ||
}); |
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
28 changes: 28 additions & 0 deletions
28
packages/astro/e2e/fixtures/svelte-component/src/pages/mdx.mdx
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,28 @@ | ||
import Counter from '../components/Counter.svelte'; | ||
import SvelteComponent from '../components/SvelteComponent.svelte'; | ||
|
||
export const someProps = { | ||
count: 0, | ||
}; | ||
|
||
<Counter id="server-only" {...someProps}> | ||
# Hello, server! | ||
</Counter> | ||
|
||
<Counter id="client-idle" {...someProps} client:idle> | ||
# Hello, client:idle! | ||
</Counter> | ||
|
||
<Counter id="client-load" {...someProps} client:load> | ||
# Hello, client:load! | ||
</Counter> | ||
|
||
<Counter id="client-visible" {...someProps} client:visible> | ||
# Hello, client:visible! | ||
</Counter> | ||
|
||
<Counter id="client-media" {...someProps} client:media="(max-width: 50em)"> | ||
# Hello, client:media! | ||
</Counter> | ||
|
||
<SvelteComponent id="client-only" client:only="svelte" /> |
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,13 +1,17 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import vue from '@astrojs/vue'; | ||
import mdx from '@astrojs/mdx'; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [vue({ | ||
template: { | ||
compilerOptions: { | ||
isCustomElement: tag => tag.includes('my-button') | ||
integrations: [ | ||
mdx(), | ||
vue({ | ||
template: { | ||
compilerOptions: { | ||
isCustomElement: tag => tag.includes('my-button') | ||
} | ||
} | ||
} | ||
})], | ||
)], | ||
}); |
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
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