Skip to content

Instantly share code, notes, and snippets.

@sidouglas
Last active February 19, 2021 10:15
Show Gist options
  • Save sidouglas/31c0b64c49c38aca6c15f6554f4f7bc8 to your computer and use it in GitHub Desktop.
Save sidouglas/31c0b64c49c38aca6c15f6554f4f7bc8 to your computer and use it in GitHub Desktop.
Live Template for JetBrains (Velocity) for a new test case
#set($pascalCaseName = ${StringUtils.removeAndHump($NAME, '-')})
#set($titleCaseName = ${pascalCaseName.replaceAll("([A-Z])", " $1").trim()})
import { mountFunction } from 'tests/unit/mount'
import $pascalCaseName from '@/components/#if($folder != '')$folder/#end$pascalCaseName'
import { getLastEvent, getLastItemFromArray } from 'tests/helpers'
describe('$titleCaseName', () => {
beforeEach(() => {
})
it('renders the component', () => {
const wrapper = mountComponent()
expect(wrapper.html()).toMatchSnapshot()
})
it('should do something', async () => {
const wrapper = mountComponent({ propsData: {} })
await wrapper.vm.${DS}nextTick()
})
})
function mountComponent ({ propsData = {} } = {}) {
return mountFunction($pascalCaseName, {
propsData: {
...propsData
},
})
}
## Do not use Reformat according to style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment