{
  "doc": {
    "id": "app/component-testing/svelte/api",
    "title": "Svelte API",
    "description": "API for mounting Svelte components in Cypress tests.",
    "section": "app",
    "source_path": "/llm/markdown/app/component-testing/svelte/api.md",
    "version": "8735fe877e6f589486e1059bc9412787edcb413d",
    "updated_at": "2026-05-26T21:47:50.835Z",
    "headings": [
      {
        "id": "app/component-testing/svelte/api#svelte-api",
        "text": "Svelte API",
        "level": 1
      },
      {
        "id": "app/component-testing/svelte/api#methods",
        "text": "Methods",
        "level": 2
      },
      {
        "id": "app/component-testing/svelte/api#mount",
        "text": "mount",
        "level": 3
      },
      {
        "id": "app/component-testing/svelte/api#example",
        "text": "Example",
        "level": 4
      },
      {
        "id": "app/component-testing/svelte/api#interfaces",
        "text": "Interfaces",
        "level": 2
      },
      {
        "id": "app/component-testing/svelte/api#mountoptions",
        "text": "MountOptions",
        "level": 3
      },
      {
        "id": "app/component-testing/svelte/api#mountreturn",
        "text": "MountReturn",
        "level": 3
      }
    ]
  },
  "content": {
    "type": "root",
    "children": [
      {
        "type": "heading",
        "depth": 1,
        "children": [
          {
            "type": "text",
            "value": "Svelte API"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Methods"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "mount"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "import { mount } from 'cypress/svelte'"
      },
      {
        "type": "html",
        "value": "<table><tbody><tr><td>Description</td><td>Mounts a Svelte component inside the Cypress browser</td></tr><tr><td>Signature</td><td><p>mount(Component: Component&lt;Record&lt;string, any&gt;, Record&lt;string, any&gt;, any&gt;, options?: MountOptions): Cypress.Chainable&lt;MountReturn&gt;</p></td></tr><tr><td>Returns</td><td>Cypress.Chainable&lt;MountReturn&gt;</td></tr></tbody></table>"
      },
      {
        "type": "html",
        "value": "<table><caption>mount Parameters</caption><thead></thead><tbody><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>component</td><td><p>Component&lt;Record&lt;string, any&gt;, Record&lt;string, any&gt;, any&gt;</p></td><td>Svelte component being mounted</td></tr><tr><td>options</td><td>MountOptions (optional)</td><td>options to customize the component being mounted</td></tr></tbody></table>"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Example"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "import Counter from './Counter.svelte'import { mount } from 'cypress/svelte'it('should render', () => {  mount(Counter, { props: { count: 42 } })  cy.get('button').contains(42)})"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Interfaces"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "MountOptions"
          }
        ]
      },
      {
        "type": "html",
        "value": "<table><caption>members</caption><thead></thead><tbody><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>anchor</td><td>Element (optional)</td><td></td></tr><tr><td>context</td><td>Map&lt;any, any&gt; (optional)</td><td></td></tr><tr><td>intro</td><td>boolean (optional)</td><td></td></tr><tr><td>log</td><td>boolean (optional)</td><td></td></tr><tr><td>props</td><td>Record&lt;string any&gt; (optional)</td><td></td></tr></tbody></table>"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "MountReturn"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Type that the `mount` function yields"
          }
        ]
      },
      {
        "type": "html",
        "value": "<table><caption>members</caption><thead></thead><tbody><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>component</td><td>Record&lt;string, any&gt;</td><td></td></tr></tbody></table>"
      }
    ]
  },
  "token_estimate": 127
}