forked from jonashackt/spring-boot-vuejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now first working Jest tests. Therefore Hello.vue now has a Component…
… property `hellomsg`, which we can check from within the test. The App also uses the new property and defines the hellomsg.
- Loading branch information
1 parent
c5beb58
commit f98d2ea
Showing
13 changed files
with
91 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
{ | ||
"env": { | ||
"mocha": true | ||
"jest": true | ||
}, | ||
"globals": { | ||
"expect": true, | ||
"sinon": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { shallowMount, createLocalVue } from '@vue/test-utils'; | ||
import VueRouter from 'vue-router' | ||
import App from '@/App'; | ||
|
||
const localVue = createLocalVue() | ||
localVue.use(VueRouter) | ||
const router = new VueRouter() | ||
|
||
describe('App component should', () => { | ||
it('render without crashing', () => { | ||
const wrapper = shallowMount(App, { | ||
localVue, | ||
router | ||
}); | ||
expect(wrapper.find('hello')).toBeDefined(); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { shallowMount } from '@vue/test-utils'; | ||
import Hello from '@/components/Hello' | ||
|
||
describe('Hello.vue', () => { | ||
it('should render correct hello message', () => { | ||
const wrapper = shallowMount(Hello, { propsData: { hellomsg: 'Welcome to your Jest powered Vue.js App' } }); | ||
const contentH1 = wrapper.find('h1'); | ||
expect(contentH1.text()).toEqual('Welcome to your Jest powered Vue.js App'); | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { shallowMount } from '@vue/test-utils'; | ||
import User from '@/components/User' | ||
|
||
describe('User.vue', () => { | ||
it('should render Create User Button', () => { | ||
const wrapper = shallowMount(User); | ||
const contentButton = wrapper.find('button'); | ||
expect(contentButton.text()).toEqual('Create User'); | ||
}) | ||
}) |