forked from carbon-design-system/carbon-tutorial-vue
-
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.
feat: add basic test setup (carbon-design-system#943)
Co-authored-by: Lee Chase <lee.chase@uk.ibm.com>
- Loading branch information
Showing
3 changed files
with
48 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: 2 | ||
jobs: | ||
test: | ||
docker: | ||
- image: circleci/node:14 | ||
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- run: yarn install --immutable --immutable-cache | ||
- run: | ||
name: Run ci checks | ||
command: yarn ci-check | ||
|
||
workflows: | ||
version: 2 | ||
main: | ||
jobs: | ||
- test |
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,12 +1,34 @@ | ||
import { shallowMount } from '@vue/test-utils'; | ||
import HelloWorld from '@/components/HelloWorld.vue'; | ||
import App from '@/App.vue'; | ||
|
||
describe('HelloWorld.vue', () => { | ||
it('renders props.msg when passed', () => { | ||
const msg = 'new message'; | ||
const wrapper = shallowMount(HelloWorld, { | ||
propsData: { msg } | ||
describe('App', () => { | ||
const dummyContent = 'dummy content'; | ||
|
||
it('should load app with dummy content', () => { | ||
const wrapper = shallowMount(App, { | ||
slots: { default: dummyContent } | ||
}); | ||
expect(wrapper.text()).toMatch(msg); | ||
const app = wrapper.find('#app'); | ||
expect(app).not.toBeNull; | ||
}); | ||
}); | ||
|
||
// describe('HelloWorld.vue', () => { | ||
// it('renders props.msg when passed', () => { | ||
// const msg = 'new message'; | ||
// const wrapper = shallowMount(HelloWorld, { | ||
// propsData: { msg } | ||
// }); | ||
// expect(wrapper.text()).toMatch(msg); | ||
// }); | ||
// }); | ||
|
||
// import React from 'react'; | ||
// import ReactDOM from 'react-dom'; | ||
// import App from './App'; | ||
|
||
// it('renders without crashing', () => { | ||
// const div = document.createElement('div'); | ||
// ReactDOM.render(<App />, div); | ||
// ReactDOM.unmountComponentAtNode(div); | ||
// }); |