Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error in moutSuspended If a component has required properties #554

Closed
Iskait opened this issue May 30, 2023 · 0 comments
Closed

Type error in moutSuspended If a component has required properties #554

Iskait opened this issue May 30, 2023 · 0 comments

Comments

@Iskait
Copy link

Iskait commented May 30, 2023

Hello!

I noticed a problem when using mountSuspended. If a component under test has at least one required property, a typing error occurs.

Code example below:

// component.vue
<script setup lang="ts">
defineProps<{
  title: string
}>()
</script>

<template>
  <div>
    {{ title }}
  </div>
</template>
// component.spec.ts
<script setup lang="ts">
import { describe, expect, test } from "vitest"
import { mountSuspended } from "nuxt-vitest/utils"
import Component from "~/components/component.vue"

describe.concurrent("Component", () => {
  test("Render", async () => {
     
     // TypeError below
    const wrapper = await mountSuspended(Component, {
      props: {
        title: "title" ,
      },
    })
  })
})
@danielroe danielroe transferred this issue from danielroe/nuxt-vitest Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants