From aa04e3b4341ab13fd648d174e364515be43ffd57 Mon Sep 17 00:00:00 2001 From: David A Kondrad Date: Thu, 19 Dec 2019 15:04:55 -0500 Subject: [PATCH] tests: validator: add tests for tag usage with/without customElement option --- .../input.svelte | 1 + .../warnings.json | 15 +++++++++++++++ .../tag-custom-element-options-true/_config.js | 3 +++ .../tag-custom-element-options-true/input.svelte | 1 + 4 files changed, 20 insertions(+) create mode 100644 test/validator/samples/tag-custom-element-options-missing/input.svelte create mode 100644 test/validator/samples/tag-custom-element-options-missing/warnings.json create mode 100644 test/validator/samples/tag-custom-element-options-true/_config.js create mode 100644 test/validator/samples/tag-custom-element-options-true/input.svelte diff --git a/test/validator/samples/tag-custom-element-options-missing/input.svelte b/test/validator/samples/tag-custom-element-options-missing/input.svelte new file mode 100644 index 0000000000..f5f5d74270 --- /dev/null +++ b/test/validator/samples/tag-custom-element-options-missing/input.svelte @@ -0,0 +1 @@ + diff --git a/test/validator/samples/tag-custom-element-options-missing/warnings.json b/test/validator/samples/tag-custom-element-options-missing/warnings.json new file mode 100644 index 0000000000..505f44e5d1 --- /dev/null +++ b/test/validator/samples/tag-custom-element-options-missing/warnings.json @@ -0,0 +1,15 @@ +[{ + "code": "missing-custom-element-compile-options", + "message": "The 'tag' option is used when generating a custom element. Did you forget the 'customElement: true' compile option?", + "start": { + "line": 1, + "column": 16, + "character": 16 + }, + "end": { + "line": 1, + "column": 36, + "character": 36 + }, + "pos": 16 +}] diff --git a/test/validator/samples/tag-custom-element-options-true/_config.js b/test/validator/samples/tag-custom-element-options-true/_config.js new file mode 100644 index 0000000000..b3c6532042 --- /dev/null +++ b/test/validator/samples/tag-custom-element-options-true/_config.js @@ -0,0 +1,3 @@ +export default { + customElement: true, +}; diff --git a/test/validator/samples/tag-custom-element-options-true/input.svelte b/test/validator/samples/tag-custom-element-options-true/input.svelte new file mode 100644 index 0000000000..f5f5d74270 --- /dev/null +++ b/test/validator/samples/tag-custom-element-options-true/input.svelte @@ -0,0 +1 @@ +