Skip to content

Commit 96864ff

Browse files
committed
getting started with vue test utils
1 parent d36bbd7 commit 96864ff

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

tests/unit/example.spec.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { shallowMount } from '@vue/test-utils'
2-
import HelloWorld from '@/components/HelloWorld.vue'
1+
import { mount } from "@vue/test-utils";
32

4-
describe('HelloWorld.vue', () => {
5-
it('renders props.msg when passed', () => {
6-
const msg = 'new message'
7-
const wrapper = shallowMount(HelloWorld, {
8-
props: { msg }
9-
})
10-
expect(wrapper.text()).toMatch(msg)
11-
})
12-
})
3+
const App = {
4+
template: `
5+
<div>Hello</div>
6+
`,
7+
};
8+
9+
test("App", () => {
10+
const wrapper = mount(App);
11+
expect(wrapper.html()).toBe("<div>Hello</div>");
12+
});

0 commit comments

Comments
 (0)