Tagged template strings are not supported
See original GitHub issueIf tagged template strings are used, test suit will fail with following error:
Tagged template strings are not supported. Use `transforms: { templateString: false }` to skip transformation and disable this error, or `transforms: { dangerousTaggedTemplateString: true }` if you know what you're doing (1:303)
at Node.initialise (node_modules/vue-template-es2015-compiler/buble.js:12998:10)
at Array.forEach (<anonymous>)
at Array.forEach (<anonymous>)
Apparently, this error message is from buble.js
.
It seems that vue-jest
uses vue-template-es2015-compiler
, and vue-template-es2015-compiler
uses buble
.
But neither vue-jest
nor vue-template-es2015-compiler
explains whether it is necessary and how to configure buble
.
Is it possible to resolve this in vue-jest
?
Any fixes or explanations are appreciated. Thank you.
I created a sample project to illustrate the issue. Steps to reproduce:
- clone https://github.com/mjss/vue-jest-with-tagged-template
- run
npm test:unit
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
Tagged template strings are not supported · Issue #720 - GitHub
I want to include the following styled-components example: const styled = require("styled-components"); const StyledBalance ...
Read more >Template literals (Template strings) - JavaScript | MDN
However, a tagged template literal may not result in a string; ... Almost all characters are allowed literally, including line breaks and ...
Read more >ES6 Template Literals (Template Strings) - CanIUse
Template literals are string literals allowing embedded expressions using backtick characters (`). You can use multi-line strings and string interpolation ...
Read more >javascript - Problem with tagged template strings and closure
Basically, if not to go in details, I use tagged template literal to temporarily change the _mode property on thread instance. So the...
Read more >Tagged template literals is not support in PHP Storm. - YouTrack
Tagged template literals is not support in PHP Storm. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals. Attachments 1.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, I’ve added a fix (or rather - I’ve extended the
vue-jest
library to address this issue) and created a PR #288.If you want to use it in your project where you have
vue-jest
as a direct dependency:npm uninstall vue-jest
oryarn remove vue-jest
,npm install --save-dev https://github.com/FRSource/vue-jest#feat-add-compile-template-options
oryarn add -D https://github.com/FRSource/vue-jest#feat-add-compile-template-options
.Or if you’re using
vue-jest
via@vue/cli-plugin-unit-jest
:package.json
:yarn install
.And ofc stay updated on when the #288 would get merged into the master to switch back to the official
vue-jest
package!No, I gave up on the apollo components a while ago!