I have a Nuxt
project containing a test file under test/index.test.js
and I'm trying to test individual components by mounting them like so:
import { Index } from './../pages/Index.vue'
import { mount } from '@vue/test-utils'
test.beforeEach(() => {
const wrapper = mount(Index)
console.log('Wrapper: ' + wrapper)
}
Which gives me the following error when running the ava
command line:
SyntaxError: /weather-app/pages/Index.vue: Unexpected token (1:0)
1 | <template>
How may I test individual components and their methods using the Ava
test runner? What's the issue here?