Skip to content

Commit 16a9da5

Browse files
committed
update tests
1 parent e62f209 commit 16a9da5

File tree

20 files changed

+85
-85
lines changed

20 files changed

+85
-85
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script>
2-
import { createEventDispatcher } from 'svelte';
3-
/**
4-
* @type {string}
5-
*/
6-
export const astring;
2+
import { createEventDispatcher } from 'svelte';
3+
/**
4+
* @type {string}
5+
*/
6+
export const astring = 'potato';
77
8-
const dispatch = createEventDispatcher();
9-
dispatch('event', true);
8+
const dispatch = createEventDispatcher();
9+
dispatch('event', true);
1010
</script>
1111

1212
<slot {astring} />
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script>
2-
import { createEventDispatcher } from 'svelte';
3-
/**
4-
* @type {string}
5-
*/
6-
export const astring;
2+
import { createEventDispatcher } from 'svelte';
3+
/**
4+
* @type {string}
5+
*/
6+
export const astring = 'potato';
77
8-
const dispatch = createEventDispatcher();
9-
dispatch('event', true);
8+
const dispatch = createEventDispatcher();
9+
dispatch('event', true);
1010
</script>
1111

1212
<slot {astring} />
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script>
2-
import { createEventDispatcher } from 'svelte';
3-
/**
4-
* @type {string}
5-
*/
6-
export const astring;
2+
import { createEventDispatcher } from 'svelte';
3+
/**
4+
* @type {string}
5+
*/
6+
export const astring = 'potato';
77
8-
const dispatch = createEventDispatcher();
9-
dispatch('event', true);
8+
const dispatch = createEventDispatcher();
9+
dispatch('event', true);
1010
</script>
1111

1212
<slot {astring} />

packages/kit/src/packaging/test/fixtures/exports-merge/expected/Test.svelte.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/** @typedef {typeof __propDef.slots} TestSlots */
44
export default class Test extends SvelteComponentTyped<
55
{
6-
astring: string;
6+
astring?: string;
77
},
88
{
99
event: CustomEvent<any>;
@@ -24,7 +24,7 @@ export type TestSlots = typeof __propDef.slots;
2424
import { SvelteComponentTyped } from 'svelte';
2525
declare const __propDef: {
2626
props: {
27-
astring: string;
27+
astring?: string;
2828
};
2929
events: {
3030
event: CustomEvent<any>;
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script>
2-
import { createEventDispatcher } from 'svelte';
3-
/**
4-
* @type {string}
5-
*/
6-
export const astring;
2+
import { createEventDispatcher } from 'svelte';
3+
/**
4+
* @type {string}
5+
*/
6+
export const astring = 'potato';
77
8-
const dispatch = createEventDispatcher();
9-
dispatch('event', true);
8+
const dispatch = createEventDispatcher();
9+
dispatch('event', true);
1010
</script>
1111

1212
<slot {astring} />
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script>
2-
import { createEventDispatcher } from 'svelte';
3-
/**
4-
* @type {string}
5-
*/
6-
export const astring;
2+
import { createEventDispatcher } from 'svelte';
3+
/**
4+
* @type {string}
5+
*/
6+
export const astring = 'potato';
77
8-
const dispatch = createEventDispatcher();
9-
dispatch('event', true);
8+
const dispatch = createEventDispatcher();
9+
dispatch('event', true);
1010
</script>
1111

1212
<slot {astring} />

packages/kit/src/packaging/test/fixtures/exports-replace/expected/Test.svelte.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/** @typedef {typeof __propDef.slots} TestSlots */
44
export default class Test extends SvelteComponentTyped<
55
{
6-
astring: string;
6+
astring?: string;
77
},
88
{
99
event: CustomEvent<any>;
@@ -24,7 +24,7 @@ export type TestSlots = typeof __propDef.slots;
2424
import { SvelteComponentTyped } from 'svelte';
2525
declare const __propDef: {
2626
props: {
27-
astring: string;
27+
astring?: string;
2828
};
2929
events: {
3030
event: CustomEvent<any>;
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script>
2-
import { createEventDispatcher } from 'svelte';
3-
/**
4-
* @type {string}
5-
*/
6-
export const astring;
2+
import { createEventDispatcher } from 'svelte';
3+
/**
4+
* @type {string}
5+
*/
6+
export const astring = 'potato';
77
8-
const dispatch = createEventDispatcher();
9-
dispatch('event', true);
8+
const dispatch = createEventDispatcher();
9+
dispatch('event', true);
1010
</script>
1111

1212
<slot {astring} />
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script>
2-
import { createEventDispatcher } from 'svelte';
3-
/**
4-
* @type {string}
5-
*/
6-
export const astring;
2+
import { createEventDispatcher } from 'svelte';
3+
/**
4+
* @type {string}
5+
*/
6+
export const astring = 'potato';
77
8-
const dispatch = createEventDispatcher();
9-
dispatch('event', true);
8+
const dispatch = createEventDispatcher();
9+
dispatch('event', true);
1010
</script>
1111

1212
<slot {astring} />

packages/kit/src/packaging/test/fixtures/files-exclude/expected/Test.svelte.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/** @typedef {typeof __propDef.slots} TestSlots */
44
export default class Test extends SvelteComponentTyped<
55
{
6-
astring: string;
6+
astring?: string;
77
},
88
{
99
event: CustomEvent<any>;
@@ -24,7 +24,7 @@ export type TestSlots = typeof __propDef.slots;
2424
import { SvelteComponentTyped } from 'svelte';
2525
declare const __propDef: {
2626
props: {
27-
astring: string;
27+
astring?: string;
2828
};
2929
events: {
3030
event: CustomEvent<any>;

packages/kit/src/packaging/test/fixtures/files-exclude/src/lib/Test.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @type {string}
55
*/
6-
export const astring;
6+
export const astring = 'potato';
77
88
const dispatch = createEventDispatcher();
99
dispatch('event', true);
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script>
2-
import { createEventDispatcher } from 'svelte';
3-
/**
4-
* @type {string}
5-
*/
6-
export const astring;
2+
import { createEventDispatcher } from 'svelte';
3+
/**
4+
* @type {string}
5+
*/
6+
export const astring = 'potato';
77
8-
const dispatch = createEventDispatcher();
9-
dispatch('event', true);
8+
const dispatch = createEventDispatcher();
9+
dispatch('event', true);
1010
</script>
1111

1212
<slot {astring} />

packages/kit/src/packaging/test/fixtures/javascript/expected/Test.svelte.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/** @typedef {typeof __propDef.slots} TestSlots */
44
export default class Test extends SvelteComponentTyped<
55
{
6-
astring: string;
6+
astring?: string;
77
},
88
{
99
event: CustomEvent<any>;
@@ -24,7 +24,7 @@ export type TestSlots = typeof __propDef.slots;
2424
import { SvelteComponentTyped } from 'svelte';
2525
declare const __propDef: {
2626
props: {
27-
astring: string;
27+
astring?: string;
2828
};
2929
events: {
3030
event: CustomEvent<any>;
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script>
2-
import { createEventDispatcher } from 'svelte';
3-
/**
4-
* @type {string}
5-
*/
6-
export const astring;
2+
import { createEventDispatcher } from 'svelte';
3+
/**
4+
* @type {string}
5+
*/
6+
export const astring = 'potato';
77
8-
const dispatch = createEventDispatcher();
9-
dispatch('event', true);
8+
const dispatch = createEventDispatcher();
9+
dispatch('event', true);
1010
</script>
1111

1212
<slot {astring} />
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script>
2-
import { createEventDispatcher } from 'svelte';
3-
export const astring;
4-
const dispatch = createEventDispatcher();
5-
dispatch('event', true);
2+
import { createEventDispatcher } from 'svelte';
3+
export const astring = 'potato';
4+
const dispatch = createEventDispatcher();
5+
dispatch('event', true);
66
</script>
77

88
<slot {astring} />

packages/kit/src/packaging/test/fixtures/typescript/expected/Test.svelte.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SvelteComponentTyped } from 'svelte';
22
declare const __propDef: {
33
props: {
4-
astring: string;
4+
astring?: string;
55
};
66
events: {
77
event: CustomEvent<boolean>;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<script>
2-
export let foo;
2+
export let foo;
33
</script>
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script lang="ts">
2-
import { createEventDispatcher } from 'svelte';
3-
export const astring: string;
2+
import { createEventDispatcher } from 'svelte';
3+
export const astring: string = 'potato';
44
5-
const dispatch = createEventDispatcher<{ event: boolean }>();
6-
dispatch('event', true);
5+
const dispatch = createEventDispatcher<{ event: boolean }>();
6+
dispatch('event', true);
77
</script>
88

99
<slot {astring} />
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<script lang="ts">
2-
import type { Foo } from './foo';
3-
export let foo: Foo;
2+
import type { Foo } from './foo';
3+
export let foo: Foo;
44
</script>

packages/kit/src/packaging/test/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function format(file, content) {
6767
content = JSON.stringify(json);
6868
}
6969
return prettier.format(content, {
70-
parser: file.endsWith('.svelte') ? 'svelte' : file.endsWith('.json') ? 'json' : 'babel-ts',
70+
parser: file.endsWith('.svelte') ? 'svelte' : file.endsWith('.json') ? 'json' : 'typescript',
7171
plugins: ['prettier-plugin-svelte']
7272
});
7373
}

0 commit comments

Comments
 (0)