Akryum / peeky

A fast and fun test runner for Vite & Node 🐈️ Powered by Vite ⚡️
https://peeky.dev
MIT License
681 stars 17 forks source link

Cannot read properties of undefined (reading 'child') #46

Closed distantnative closed 2 years ago

distantnative commented 2 years ago

Using pesky 0.8.2, I get the following error when trying to run a component test:

Cannot read properties of undefined (reading 'child')
    at createWrapper (node_modules/@vue/test-utils/dist/vue-test-utils.js:11371:32)
    at Module.mount (node_modules/@vue/test-utils/dist/vue-test-utils.js:14071:10)
    at Object.handler (src/components/Misc/Text.test.js:8:21)

The Text.test.js:

import { mount } from "@vue/test-utils";
import Text from "./Text.vue";

describe("vue + peeky demo", () => {
  test("mount component", async () => {
    expect(Text).toBeTruthy();

    const wrapper = mount(Text, {
      props: {
        align: "left"
      }
    });

    expect(wrapper.attributes("data-align")).toBe("left");
  });
});
Akryum commented 2 years ago

Fixed in https://github.com/Akryum/peeky/commit/3758ee735b15145507a792915e20ae1fb5befc54