webfansplz / vuejs-challenges

Collection of Vue.js challenges
https://vuejs-challenges.netlify.app/
MIT License
2.73k stars 189 forks source link

1 - Hello World #2827

Open varlog762 opened 1 month ago

varlog762 commented 1 month ago

import { mount } from "@vue/test-utils"
import { describe, it, expect } from "vitest"

import HelloWorld from "./App.vue"

interface HelloWorldProps {
  msg: string
}

describe("HelloWorld", () => {
  it("renders a 'Hello World'", () => {
    const wrapper = mount(HelloWorld)
    const msg = (wrapper.vm as unknown as HelloWorldProps).msg
    expect(wrapper.text()).toBe(msg)
  })
})```

<!--

OR Vue SFC Playground Link (https://sfc.vuejs.org)

-->