Initial commit 🚀

This commit is contained in:
2022-02-28 20:07:01 +01:00
commit 08f616fe70
53 changed files with 4735 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
// Vitest Snapshot v1
exports[`Counter.vue > should render 1`] = `"<div>10 <button class=\\"inc\\"> + </button><button class=\\"dec\\"> - </button></div>"`;

5
test/basic.test.ts Normal file
View File

@@ -0,0 +1,5 @@
describe('Hi', () => {
it('should works', () => {
expect(1 + 1).toEqual(2)
})
})

20
test/component.test.ts Normal file
View File

@@ -0,0 +1,20 @@
import { mount } from '@vue/test-utils'
describe('Counter.vue', () => {
it('should render', () => {
const wrapper = mount(Counter, { props: { initial: 10 } })
expect(wrapper.text()).toContain('10')
expect(wrapper.html()).toMatchSnapshot()
})
it('should be interactive', async() => {
const wrapper = mount(Counter, { props: { initial: 0 } })
expect(wrapper.text()).toContain('0')
expect(wrapper.find('.inc').exists()).toBe(true)
await wrapper.get('button').trigger('click')
expect(wrapper.text()).toContain('1')
})
})