Nov 19, 2015
0
Level 2
How to unit test a .vue component
I am in a process to unit test a vue component using Jasmine. The component is in a .vue file containing <script> and <template> tag. The following codes caused an error (it doesn’t like the script or template tags).
Vue.component(‘test’, require(‘./path/to/.vue’));
Any idea how to fix this error?
(function (exports, require, module, __filename, __dirname) { `<template>`
^
SyntaxError: Unexpected token <
Thanks.
Please or to participate in this conversation.