I am trying to write the unit test cases for my component but I am getting the error not able to render the component
Error I am getting
'''console.warn
[Vue warn]: Component is missing template or render function.
at <Anonymous msg="Hello Jest" ref="VTU_COMPONENT" >
at <VTUROOT>'''
And I am using vue.config.js as my config file
hello.vue
<template>
<div>
<div>
<h1>{{ msg }}</h1>
<p>...</p>
</div>
</div>
</template>
<script>
export default {
props: {
msg: {
type: String,
required: true
}
}
}
</script>
hello.spec.js
import HelloWorld from "../../src/hello.vue";
import { mount } from "@vue/test-utils";
describe("HelloWorld", () => {
it("renders properly", () => {
const wrapper = mount(HelloWorld, { props: { msg: "Hello Jest" } });
expect(wrapper.text()).toContain("Hello Jest");
});
})
;
Attaching some screen grab for better reference