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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 BUG: Import of vue file results in error #531

Open
sschneider-ihre-pvs opened this issue Feb 10, 2023 · 2 comments
Open

馃悰 BUG: Import of vue file results in error #531

sschneider-ihre-pvs opened this issue Feb 10, 2023 · 2 comments

Comments

@sschneider-ihre-pvs
Copy link

sschneider-ihre-pvs commented Feb 10, 2023

When I try to run tests that include imports of vue files I get this weird error message. btw there is no actual file file.js
@IlCallo just in case you also have an idea
also, this looks a bit like babel expected a js file while given ts?!

  transform: {
    '^.+\\.js$': 'babel-jest',
    '^.+\\.ts$': 'ts-jest',
    '^.+\\.vue$': '@vue/vue3-jest',

    '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
      'jest-transform-stub',
  },

also doesn't matter if I use babel-jest or ts-jest for ts files.

file.js: Unexpected token, expected "," (3:27)

      1 | import { resolveComponent as _resolveComponent, mergeProps as _mergeProps, openBlock as _openBlock, createBlock as _createBlock } from "vue"
      2 |
    > 3 | export function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {
        |                            ^
      4 |   const _component_q_input = _resolveComponent("q-input")!
      5 |
      6 |   return (_openBlock(), _createBlock(_component_q_input, _mergeProps(_ctx.$attrs, {

@babel+parser@7.20.15
@babel+core@7.20.12
@jest+transform@29.4.2
@vue+vue3-jest@29.2.2

@sschneider-ihre-pvs
Copy link
Author

Guess around there has to be the problem

const babelify = transform(result.code, {

@sschneider-ihre-pvs
Copy link
Author

could it be that vue-jest by default looks in the cwd for a tsconfig.json instead of ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant