mirror of https://github.com/sveltejs/svelte
parent
d016532732
commit
8dc4f2bf24
@ -0,0 +1,11 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: '<button>clicks: 0</button>',
|
||||
|
||||
async test({ assert, target }) {
|
||||
const btn = target.querySelector('button');
|
||||
await btn?.click();
|
||||
assert.htmlEqual(target.innerHTML, `<button>clicks: 1</button>`);
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,23 @@
|
||||
<script context="module" lang="ts">
|
||||
interface Hello { message: 'hello' }
|
||||
type Goodbye = { message: 'goodbye' };
|
||||
|
||||
export type { Hello };
|
||||
</script>
|
||||
|
||||
<script>
|
||||
import type { Foo } from './types';
|
||||
import { type Bar, type Baz } from './types';
|
||||
|
||||
let count = $state(0);
|
||||
const person = {
|
||||
message: 'goodbye'
|
||||
} satisfies Goodbye;
|
||||
</script>
|
||||
|
||||
<button
|
||||
on:click={(e: MouseEvent) => {
|
||||
const next: number = count + 1;
|
||||
count = next! as number;
|
||||
}}
|
||||
>clicks: {count}</button>
|
||||
@ -0,0 +1,3 @@
|
||||
export interface Foo {}
|
||||
export interface Bar {}
|
||||
export interface Baz {}
|
||||
Loading…
Reference in new issue