example.spec.js 346 B

12345678910111213
  1. import { shallowMount } from "@vue/test-utils";
  2. import HelloWorld from "@/components/HelloWorld.vue";
  3. describe("HelloWorld.vue", () => {
  4. it("renders props.msg when passed", () => {
  5. const msg = "new message";
  6. const wrapper = shallowMount(HelloWorld, {
  7. propsData: { msg }
  8. });
  9. expect(wrapper.text()).toMatch(msg);
  10. });
  11. });