Skip to content

Commit b46c0cc

Browse files
author
Walker Leite
committed
test(HelloWorld): refactor test to work with jest
1 parent 440c934 commit b46c0cc

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import Vue from 'vue';
1+
import { mount } from 'vue-test-utils';
22
import HelloWorld from '@/components/HelloWorld/HelloWorld.vue';
33

44
describe('HelloWorld.vue', () => {
5-
const Constructor = Vue.extend(HelloWorld);
5+
const wrapper = mount(HelloWorld);
66

77
it('should render correct content', () => {
8-
const vm = new Constructor().$mount();
9-
return Vue.nextTick().then(() => {
10-
expect(vm.$el.innerHTML).toContain(
11-
'Hello World! This content is restricted.'
12-
);
13-
});
8+
expect(wrapper.html()).toContain(
9+
'Hello World! This content is restricted.'
10+
);
1411
});
1512
});

0 commit comments

Comments
 (0)