Skip to content

Commit 3626d7c

Browse files
committed
update
1 parent 76e094e commit 3626d7c

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

tests/fixtures/parser/ast/svelte5/docs/snippets/10-typing-snippets-type-output.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<table>
1212
{#if children} <!-- children: Snippet<[]> -->
1313
<thead>
14-
<tr>{@render children()}</tr> <!-- children(): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
14+
<tr>{@render children()}</tr> <!-- children(): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
1515
</thead>
1616
{/if}
1717
<tbody>
1818
{#each data as d} <!-- data: any[], d: any -->
19-
<tr>{@render row(d)}</tr> <!-- row(d): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
19+
<tr>{@render row(d)}</tr> <!-- row(d): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
2020
{/each}
2121
</tbody>
2222
</table>

tests/fixtures/parser/ast/svelte5/docs/snippets/11-typing-snippets-type-output.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<table>
1212
{#if children} <!-- children: Snippet<[]> -->
1313
<thead>
14-
<tr>{@render children()}</tr> <!-- children(): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
14+
<tr>{@render children()}</tr> <!-- children(): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
1515
</thead>
1616
{/if}
1717
<tbody>
1818
{#each data as d} <!-- data: unknown[], d: unknown -->
19-
<tr>{@render row(d)}</tr> <!-- row(d): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
19+
<tr>{@render row(d)}</tr> <!-- row(d): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
2020
{/each}
2121
</tbody>
2222
</table>

tests/fixtures/parser/ast/svelte5/generics01-snippets-type-output.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
<table>
1313
{#if children} <!-- children: Snippet<[]> -->
1414
<thead>
15-
<tr>{@render children()}</tr> <!-- children(): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
15+
<tr>{@render children()}</tr> <!-- children(): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
1616
</thead>
1717
{/if}
1818
<tbody>
1919
{#each data as d} <!-- data: unknown[], d: unknown -->
20-
<tr>{@render row(d)}</tr> <!-- row(d): unique symbol & { _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\""; } -->
20+
<tr>{@render row(d)}</tr> <!-- row(d): { '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'"; } & unique symbol -->
2121
{/each}
2222
</tbody>
2323
</table>

tools/update-fixtures.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,16 @@ for (const { input, inputFileName, outputFileName, config } of listupFixtures(
135135
}
136136
}
137137

138-
for (const { input, inputFileName, outputFileName, config } of listupFixtures(
139-
STYLE_CONTEXT_FIXTURE_ROOT,
140-
)) {
138+
for (const {
139+
input,
140+
inputFileName,
141+
outputFileName,
142+
config,
143+
meetRequirements,
144+
} of listupFixtures(STYLE_CONTEXT_FIXTURE_ROOT)) {
145+
if (!meetRequirements("parse")) {
146+
continue;
147+
}
141148
const result = parse(input, inputFileName, config);
142149
const styleContext = result.services.getStyleContext();
143150
fs.writeFileSync(
@@ -147,9 +154,16 @@ for (const { input, inputFileName, outputFileName, config } of listupFixtures(
147154
);
148155
}
149156

150-
for (const { input, inputFileName, outputFileName, config } of listupFixtures(
151-
STYLE_LOCATION_FIXTURE_ROOT,
152-
)) {
157+
for (const {
158+
input,
159+
inputFileName,
160+
outputFileName,
161+
config,
162+
meetRequirements,
163+
} of listupFixtures(STYLE_LOCATION_FIXTURE_ROOT)) {
164+
if (!meetRequirements("parse")) {
165+
continue;
166+
}
153167
const services = parse(input, inputFileName, config).services;
154168
if (!services.isSvelte) continue;
155169
const styleContext = services.getStyleContext();

0 commit comments

Comments
 (0)