Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support v-slot token #18

Closed
iwata opened this issue Jul 12, 2019 · 2 comments
Closed

Support v-slot token #18

iwata opened this issue Jul 12, 2019 · 2 comments
Labels

Comments

@iwata
Copy link

iwata commented Jul 12, 2019

Vue 2.6.0+ recommends v-slot instead of slot attribute.
https://vuejs.org/v2/guide/components-slots.html#Named-Slots-with-the-slot-Attribute
But jest-serializer-vue don't support it and using it causes an error.
The actual error messages I encountered are listed below:

I'm using these versions:

 FAIL  test/index.spec.ts
  ● Test suite failed to run

    Jest encountered an unexpected token

    This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

    By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

    Here's what you can do:
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/en/configuration.html

    Details:

    SyntaxError: Unexpected token (1:839)
    1 : function render () {with(this){return _c('main',{staticClass:"column main"},[_c('organized-breadcrumbs',{attrs:{"org-path":orgPath,"org-title":orgTitle}},[_c('li',[_c('a',[_v("Business")])]),_c('li',[_c('nuxt-link',{attrs:{"to":termsPath}},[_v("利用規約文書")])],1),_c('li',{staticClass:"is-active"},[_c('a',{attrs:{"aria-content":"page"}},[_v(_s(title))])])]),_c('business-tabs',{attrs:{"org":org,"active":"terms"}},[_c('template',{slot:"terms"},[_c('term-document',{attrs:{"title":title,"original-body":original.body,"body":body,"is-processing":isProcessing,"enable-button":hasDiff,"services":services,"is-editting":true,"can-save":canSave,"can-remove":canRemove},on:{"update:title":function($event){title=$event},"update:body":function($event){body=$event},"save":save,"remove":removeConfirm},scopedSlots:_u([{key:"service-list",fn:function(v-slot:service-list){return _l((services),function(service){return _c('b-tag',{key:service.id,attrs:{"type":"is-info"}},[_v(_s(service.groupRef.name)+" / "+_s(service.name))])})}}])})],1)],2)],1)}}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ^

      at Parser.pp$4.raise (node_modules/vue-template-es2015-compiler/buble.js:2757:13)
      at Parser.pp.unexpected (node_modules/vue-template-es2015-compiler/buble.js:647:8)
      at Parser.pp.expect (node_modules/vue-template-es2015-compiler/buble.js:641:26)
      at Parser.pp$2.parseBindingList (node_modules/vue-template-es2015-compiler/buble.js:1694:19)
      at Parser.pp$1.parseFunctionParams (node_modules/vue-template-es2015-compiler/buble.js:1231:22)
      at Parser.pp$1.parseFunction (node_modules/vue-template-es2015-compiler/buble.js:1218:8)
      at Parser.pp$3.parseExprAtom (node_modules/vue-template-es2015-compiler/buble.js:2184:17)
      at Parser.<anonymous> (node_modules/vue-template-es2015-compiler/buble.js:6003:24)
      at Parser.parseExprAtom (node_modules/vue-template-es2015-compiler/buble.js:6129:31)
      at Parser.pp$3.parseExprSubscripts (node_modules/vue-template-es2015-compiler/buble.js:2047:19)
  • jest-serializer-vue: 2.0.2
  • Vue: 2.6.10
  • Jest: 24.8.0
@iwata
Copy link
Author

iwata commented Aug 2, 2019

Do you have any responses?

@TheJaredWilcurt
Copy link
Contributor

@iwata Can you try with my fork?

If the issue still occurs. You can create an issue on that repo with a code sample to reproduce it, and I'll take a look.

@iwata iwata closed this as completed Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants