Open Maseline opened 3 years ago
I have the same issue running Vue 2.7 with Jest 27
console.error
[Vue warn]: Failed to resolve async component: function PulseLoader() {
return Promise.resolve().then(function () {
return (0, _interopRequireWildcard2.default)(require('vue-spinner/src/PulseLoader.vue'));
});
}
Reason: SyntaxError: Unexpected token '<'
I have the same issue running Vue 2.7 with Jest 27
console.error [Vue warn]: Failed to resolve async component: function PulseLoader() { return Promise.resolve().then(function () { return (0, _interopRequireWildcard2.default)(require('vue-spinner/src/PulseLoader.vue')); }); } Reason: SyntaxError: Unexpected token '<'
I ended up mocking the component for the time being since it's not really useful for the test case I needed. At least this won't be a blocker if you want to test your component.
jest.mock('vue-spinner/src/PulseLoader.vue', () => ({
render: (h) => h('div', 'PulseLoader'),
}))
What's the right way to configure jest when using vue-spinner package. After adding the package, tests fail with this: ` Jest encountered an unexpected token
Tried the suggestions there but no success. My current jest config file:
{ "preset": "jest-puppeteer", "testRegex": "./new-e2e/.*.js$" }