From 3e385735ab1d10a5e90fde2d44746bdf7015999e Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Fri, 25 Oct 2024 11:49:45 -0700 Subject: [PATCH] test(rest-props): rename `rest-props` example to avoid name clash (#142) --- tests/__snapshots__/fixtures.test.ts.snap | 58 +++++++++---------- .../input.svelte | 0 .../output.d.ts | 4 +- .../output.json | 0 4 files changed, 31 insertions(+), 31 deletions(-) rename tests/fixtures/{rest-props => rest-props-simple}/input.svelte (100%) rename tests/fixtures/{rest-props => rest-props-simple}/output.d.ts (52%) rename tests/fixtures/{rest-props => rest-props-simple}/output.json (100%) diff --git a/tests/__snapshots__/fixtures.test.ts.snap b/tests/__snapshots__/fixtures.test.ts.snap index cfe9b514..670c91ae 100644 --- a/tests/__snapshots__/fixtures.test.ts.snap +++ b/tests/__snapshots__/fixtures.test.ts.snap @@ -893,21 +893,6 @@ exports[`fixtures (JSON) "context-module/input.svelte" 1`] = ` }" `; -exports[`fixtures (JSON) "rest-props/input.svelte" 1`] = ` -"{ - "props": [], - "moduleExports": [], - "slots": [], - "events": [], - "typedefs": [], - "generics": null, - "rest_props": { - "type": "Element", - "name": "h1" - } -}" -`; - exports[`fixtures (JSON) "rest-props-multiple/input.svelte" 1`] = ` "{ "props": [ @@ -1059,6 +1044,21 @@ exports[`fixtures (JSON) "typedef/input.svelte" 1`] = ` }" `; +exports[`fixtures (JSON) "rest-props-simple/input.svelte" 1`] = ` +"{ + "props": [], + "moduleExports": [], + "slots": [], + "events": [], + "typedefs": [], + "generics": null, + "rest_props": { + "type": "Element", + "name": "h1" + } +}" +`; + exports[`fixtures (JSON) "anchor-props/input.svelte" 1`] = ` "{ "props": [], @@ -1715,20 +1715,6 @@ export default class ContextModule extends SvelteComponentTyped, {}> {} -" -`; - exports[`fixtures (TypeScript) "rest-props-multiple/input.svelte" 1`] = ` "import type { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; @@ -1822,6 +1808,20 @@ export default class Typedef extends SvelteComponentTyped< " `; +exports[`fixtures (TypeScript) "rest-props-simple/input.svelte" 1`] = ` +"import type { SvelteComponentTyped } from "svelte"; +import type { SvelteHTMLElements } from "svelte/elements"; + +type RestProps = SvelteHTMLElements["h1"]; + +export interface RestPropsSimpleProps extends RestProps { + [key: \`data-${string}\`]: any; +} + +export default class RestPropsSimple extends SvelteComponentTyped, {}> {} +" +`; + exports[`fixtures (TypeScript) "anchor-props/input.svelte" 1`] = ` "import type { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; diff --git a/tests/fixtures/rest-props/input.svelte b/tests/fixtures/rest-props-simple/input.svelte similarity index 100% rename from tests/fixtures/rest-props/input.svelte rename to tests/fixtures/rest-props-simple/input.svelte diff --git a/tests/fixtures/rest-props/output.d.ts b/tests/fixtures/rest-props-simple/output.d.ts similarity index 52% rename from tests/fixtures/rest-props/output.d.ts rename to tests/fixtures/rest-props-simple/output.d.ts index e99f7168..324dabbd 100644 --- a/tests/fixtures/rest-props/output.d.ts +++ b/tests/fixtures/rest-props-simple/output.d.ts @@ -3,8 +3,8 @@ import type { SvelteHTMLElements } from "svelte/elements"; type RestProps = SvelteHTMLElements["h1"]; -export interface RestPropsProps extends RestProps { +export interface RestPropsSimpleProps extends RestProps { [key: `data-${string}`]: any; } -export default class RestProps extends SvelteComponentTyped, {}> {} +export default class RestPropsSimple extends SvelteComponentTyped, {}> {} diff --git a/tests/fixtures/rest-props/output.json b/tests/fixtures/rest-props-simple/output.json similarity index 100% rename from tests/fixtures/rest-props/output.json rename to tests/fixtures/rest-props-simple/output.json