From 94570799a757f1f1f4aa05a669483a2922566c5e Mon Sep 17 00:00:00 2001 From: mojinming Date: Mon, 12 Dec 2022 13:41:24 +0800 Subject: [PATCH] test: add tests --- .../slotted-element-with-ignores/input.svelte | 4 ++ .../slotted-element-with-ignores/output.json | 72 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 test/parser/samples/slotted-element-with-ignores/input.svelte create mode 100644 test/parser/samples/slotted-element-with-ignores/output.json diff --git a/test/parser/samples/slotted-element-with-ignores/input.svelte b/test/parser/samples/slotted-element-with-ignores/input.svelte new file mode 100644 index 0000000000..cfa1c38d13 --- /dev/null +++ b/test/parser/samples/slotted-element-with-ignores/input.svelte @@ -0,0 +1,4 @@ + + + + diff --git a/test/parser/samples/slotted-element-with-ignores/output.json b/test/parser/samples/slotted-element-with-ignores/output.json new file mode 100644 index 0000000000..da0739ca77 --- /dev/null +++ b/test/parser/samples/slotted-element-with-ignores/output.json @@ -0,0 +1,72 @@ +{ + "html": { + "start": 0, + "end": 92, + "type": "Fragment", + "children": [ + { + "start": 0, + "end": 92, + "type": "InlineComponent", + "name": "Component", + "attributes": [], + "children": [ + { + "start": 11, + "end": 13, + "type": "Text", + "raw": "\n\t", + "data": "\n\t" + }, + { + "start": 13, + "end": 58, + "type": "Comment", + "data": " svelte-ignore a11y-missing-attribute ", + "ignores": [ + "a11y-missing-attribute" + ] + }, + { + "start": 58, + "end": 61, + "type": "Text", + "raw": " \n\t", + "data": " \n\t" + }, + { + "start": 61, + "end": 79, + "type": "Element", + "name": "a", + "attributes": [ + { + "start": 64, + "end": 74, + "type": "Attribute", + "name": "slot", + "value": [ + { + "start": 70, + "end": 73, + "type": "Text", + "raw": "foo", + "data": "foo" + } + ] + } + ], + "children": [] + }, + { + "start": 79, + "end": 80, + "type": "Text", + "raw": "\n", + "data": "\n" + } + ] + } + ] + } +}