= T extends {
- (source: string, options: { filename?: string; modern: true }): infer R;
- (...args: any[]): any;
-}
- ? R
- : any;
diff --git a/tests/fixtures/parser/ast/self-closing-style01-requirements.json b/tests/fixtures/parser/ast/self-closing-style01-requirements.json
new file mode 100644
index 00000000..30d7612a
--- /dev/null
+++ b/tests/fixtures/parser/ast/self-closing-style01-requirements.json
@@ -0,0 +1,5 @@
+{
+ "parse": {
+ "svelte": "^4 || ^3"
+ }
+}
\ No newline at end of file
diff --git a/tests/fixtures/parser/ast/svelte5/docs/snippets/10-typing-snippets-type-output.svelte b/tests/fixtures/parser/ast/svelte5/docs/snippets/10-typing-snippets-type-output.svelte
index d992f19b..2009d36a 100644
--- a/tests/fixtures/parser/ast/svelte5/docs/snippets/10-typing-snippets-type-output.svelte
+++ b/tests/fixtures/parser/ast/svelte5/docs/snippets/10-typing-snippets-type-output.svelte
@@ -11,12 +11,12 @@
{#if children}
- {@render children()}
+ {@render children()}
{/if}
{#each data as d}
- {@render row(d)}
+ {@render row(d)}
{/each}
diff --git a/tests/fixtures/parser/ast/svelte5/docs/snippets/11-typing-snippets-type-output.svelte b/tests/fixtures/parser/ast/svelte5/docs/snippets/11-typing-snippets-type-output.svelte
index 4c5b05d6..204db6f5 100644
--- a/tests/fixtures/parser/ast/svelte5/docs/snippets/11-typing-snippets-type-output.svelte
+++ b/tests/fixtures/parser/ast/svelte5/docs/snippets/11-typing-snippets-type-output.svelte
@@ -11,12 +11,12 @@
{#if children}
- {@render children()}
+ {@render children()}
{/if}
{#each data as d}
- {@render row(d)}
+ {@render row(d)}
{/each}
diff --git a/tests/fixtures/parser/ast/svelte5/generics01-snippets-type-output.svelte b/tests/fixtures/parser/ast/svelte5/generics01-snippets-type-output.svelte
index 3490d02c..9511f75b 100644
--- a/tests/fixtures/parser/ast/svelte5/generics01-snippets-type-output.svelte
+++ b/tests/fixtures/parser/ast/svelte5/generics01-snippets-type-output.svelte
@@ -12,12 +12,12 @@
{#if children}
- {@render children()}
+ {@render children()}
{/if}
{#each data as d}
- {@render row(d)}
+ {@render row(d)}
{/each}
diff --git a/tests/fixtures/parser/style-context/self-closing-style-element-requirements.json b/tests/fixtures/parser/style-context/self-closing-style-element-requirements.json
new file mode 100644
index 00000000..30d7612a
--- /dev/null
+++ b/tests/fixtures/parser/style-context/self-closing-style-element-requirements.json
@@ -0,0 +1,5 @@
+{
+ "parse": {
+ "svelte": "^4 || ^3"
+ }
+}
\ No newline at end of file
diff --git a/tests/src/parser/__snapshots__/html.ts.snap b/tests/src/parser/__snapshots__/html.ts.snap
index 56794774..344231d9 100644
--- a/tests/src/parser/__snapshots__/html.ts.snap
+++ b/tests/src/parser/__snapshots__/html.ts.snap
@@ -12,16 +12,13 @@ Object {
"attributes": Array [
Object {
"end": 17,
- "metadata": null,
"name": "lang",
- "parent": null,
"start": 8,
"type": "Attribute",
"value": Array [
Object {
"data": "ts",
"end": 16,
- "parent": null,
"raw": "ts",
"start": 14,
"type": "Text",
@@ -38,16 +35,13 @@ Object {
"attributes": Array [
Object {
"end": 17,
- "metadata": null,
"name": "lang",
- "parent": null,
"start": 8,
"type": "Attribute",
"value": Array [
Object {
"data": "ts",
"end": 16,
- "parent": null,
"raw": "ts",
"start": 14,
"type": "Text",
@@ -64,16 +58,13 @@ Object {
"attributes": Array [
Object {
"end": 15,
- "metadata": null,
"name": "lang",
- "parent": null,
"start": 8,
"type": "Attribute",
"value": Array [
Object {
"data": "ts",
"end": 15,
- "parent": null,
"raw": "ts",
"start": 13,
"type": "Text",
@@ -90,9 +81,7 @@ Object {
"attributes": Array [
Object {
"end": 13,
- "metadata": null,
"name": "global",
- "parent": null,
"start": 7,
"type": "Attribute",
"value": true,
@@ -107,9 +96,7 @@ Object {
"attributes": Array [
Object {
"end": 13,
- "metadata": null,
"name": "global",
- "parent": null,
"start": 7,
"type": "Attribute",
"value": true,
@@ -124,9 +111,7 @@ Object {
"attributes": Array [
Object {
"end": 4,
- "metadata": null,
"name": "attr",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": true,
@@ -141,16 +126,13 @@ Object {
"attributes": Array [
Object {
"end": 16,
- "metadata": null,
"name": "attr",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": Array [
Object {
"data": "value",
"end": 15,
- "parent": null,
"raw": "value",
"start": 10,
"type": "Text",
@@ -167,9 +149,7 @@ Object {
"attributes": Array [
Object {
"end": 4,
- "metadata": null,
"name": "attr",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": true,
@@ -184,16 +164,13 @@ Object {
"attributes": Array [
Object {
"end": 12,
- "metadata": null,
"name": "attr",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": Array [
Object {
"data": "value",
"end": 11,
- "parent": null,
"raw": "value",
"start": 6,
"type": "Text",
@@ -210,16 +187,13 @@ Object {
"attributes": Array [
Object {
"end": 8,
- "metadata": null,
"name": "empty",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": Array [
Object {
"data": "",
"end": 7,
- "parent": null,
"raw": "",
"start": 7,
"type": "Text",
@@ -236,16 +210,13 @@ Object {
"attributes": Array [
Object {
"end": 8,
- "metadata": null,
"name": "empty",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": Array [
Object {
"data": "",
"end": 7,
- "parent": null,
"raw": "",
"start": 7,
"type": "Text",
@@ -262,9 +233,7 @@ Object {
"attributes": Array [
Object {
"end": 13,
- "metadata": null,
"name": "expr",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": Array [
@@ -278,8 +247,6 @@ Object {
"type": "Literal",
"value": true,
},
- "metadata": null,
- "parent": null,
"start": 5,
"type": "ExpressionTag",
},
@@ -295,9 +262,7 @@ Object {
"attributes": Array [
Object {
"end": 13,
- "metadata": null,
"name": "expr",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": Array [
@@ -311,8 +276,6 @@ Object {
"type": "Literal",
"value": true,
},
- "metadata": null,
- "parent": null,
"start": 5,
"type": "ExpressionTag",
},
@@ -328,9 +291,7 @@ Object {
"attributes": Array [
Object {
"end": 10,
- "metadata": null,
"name": "expr",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": Array [
@@ -344,8 +305,6 @@ Object {
"type": "Literal",
"value": "}",
},
- "metadata": null,
- "parent": null,
"start": 5,
"type": "ExpressionTag",
},
@@ -361,9 +320,7 @@ Object {
"attributes": Array [
Object {
"end": 10,
- "metadata": null,
"name": "expr",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": Array [
@@ -377,8 +334,6 @@ Object {
"type": "Literal",
"value": "s",
},
- "metadata": null,
- "parent": null,
"start": 5,
"type": "ExpressionTag",
},
@@ -394,9 +349,7 @@ Object {
"attributes": Array [
Object {
"end": 15,
- "metadata": null,
"name": "expr",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": Array [
@@ -417,8 +370,6 @@ Object {
"type": "Literal",
"value": "}",
},
- "metadata": null,
- "parent": null,
"start": 5,
"type": "ExpressionTag",
},
@@ -435,9 +386,7 @@ Object {
"attributes": Array [
Object {
"end": 19,
- "metadata": null,
"name": "expr",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": Array [
@@ -464,8 +413,6 @@ Object {
"type": "Literal",
"value": "}",
},
- "metadata": null,
- "parent": null,
"start": 5,
"type": "ExpressionTag",
},
@@ -481,9 +428,7 @@ Object {
"attributes": Array [
Object {
"end": 11,
- "metadata": null,
"name": "expr",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": Array [
@@ -497,8 +442,6 @@ Object {
"type": "Literal",
"value": true,
},
- "metadata": null,
- "parent": null,
"start": 5,
"type": "ExpressionTag",
},
@@ -514,16 +457,13 @@ Object {
"attributes": Array [
Object {
"end": 9,
- "metadata": null,
"name": "quote",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": Array [
Object {
"data": "'",
"end": 8,
- "parent": null,
"raw": "'",
"start": 7,
"type": "Text",
@@ -540,16 +480,13 @@ Object {
"attributes": Array [
Object {
"end": 9,
- "metadata": null,
"name": "quote",
- "parent": null,
"start": 0,
"type": "Attribute",
"value": Array [
Object {
"data": "\\"",
"end": 8,
- "parent": null,
"raw": "\\"",
"start": 7,
"type": "Text",
diff --git a/tests/src/parser/style-context.ts b/tests/src/parser/style-context.ts
index 87aee31a..109e71e8 100644
--- a/tests/src/parser/style-context.ts
+++ b/tests/src/parser/style-context.ts
@@ -26,6 +26,9 @@ describe("Check for AST.", () => {
config,
meetRequirements,
} of listupFixtures(STYLE_CONTEXT_FIXTURE_ROOT)) {
+ if (!meetRequirements("parse")) {
+ continue;
+ }
describe(inputFileName, () => {
let result: any;
diff --git a/tools/update-fixtures.ts b/tools/update-fixtures.ts
index 2099969a..cc43ee7e 100644
--- a/tools/update-fixtures.ts
+++ b/tools/update-fixtures.ts
@@ -135,9 +135,16 @@ for (const { input, inputFileName, outputFileName, config } of listupFixtures(
}
}
-for (const { input, inputFileName, outputFileName, config } of listupFixtures(
- STYLE_CONTEXT_FIXTURE_ROOT,
-)) {
+for (const {
+ input,
+ inputFileName,
+ outputFileName,
+ config,
+ meetRequirements,
+} of listupFixtures(STYLE_CONTEXT_FIXTURE_ROOT)) {
+ if (!meetRequirements("parse")) {
+ continue;
+ }
const result = parse(input, inputFileName, config);
const styleContext = result.services.getStyleContext();
fs.writeFileSync(
@@ -147,9 +154,16 @@ for (const { input, inputFileName, outputFileName, config } of listupFixtures(
);
}
-for (const { input, inputFileName, outputFileName, config } of listupFixtures(
- STYLE_LOCATION_FIXTURE_ROOT,
-)) {
+for (const {
+ input,
+ inputFileName,
+ outputFileName,
+ config,
+ meetRequirements,
+} of listupFixtures(STYLE_LOCATION_FIXTURE_ROOT)) {
+ if (!meetRequirements("parse")) {
+ continue;
+ }
const services = parse(input, inputFileName, config).services;
if (!services.isSvelte) continue;
const styleContext = services.getStyleContext();
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy