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

Running examples/vue-app-ts tests throws "Preset vite-jest is invalid" #19

Open
imomaliev opened this issue Aug 3, 2021 · 2 comments
Open

Comments

@imomaliev
Copy link

imomaliev commented Aug 3, 2021

Runnig vite-jest in example vue-app-ts throws an error.

Steps to reproduce

  1. git clone [email protected]:sodatea/vite-jest.git

  2. cd examples/vue-app-ts

  3. Update package.json

    -    "vite-jest": "workspace:*",
    +    "vite-jest": "^0.0.3",
    
  4. npm i

  5. npm run test:unit

    $ npm run test:unit
    
    > test:unit
    > vite-jest
    
    ● Validation Error:
    
      Preset vite-jest is invalid:
    
      String.prototype.startsWith called on null or undefined
      TypeError: String.prototype.startsWith called on null or undefined
        at startsWith (<anonymous>)
        at node:internal/errors:811:19
        at Array.filter (<anonymous>)
        at node:internal/errors:809:16
        at prepareStackTrace (node:internal/errors:96:12)
        at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:38)
        at Module.load (node:internal/modules/cjs/loader:981:32)
        at Function.Module._load (node:internal/modules/cjs/loader:822:12)
        at Module.require (node:internal/modules/cjs/loader:1005:19)
        at require (node:internal/modules/cjs/helpers:94:18)
    
      Configuration Documentation:
      https://jestjs.io/docs/configuration
    
    /path/to/project/vite-jest/examples/vue-app-ts/node_modules/execa/lib/error.js:60
                    error = new Error(message);
                            ^
    
    Error: Command failed with exit code 1: node --experimental-vm-modules /path/to/project/vite-jest/examples/vue-app-ts/node_modules/jest/bin/jest.js
        at makeError (/path/to/project/vite-jest/examples/vue-app-ts/node_modules/execa/lib/error.js:60:11)
        at Function.module.exports.sync (/path/to/project/vite-jest/examples/vue-app-ts/node_modules/execa/index.js:194:17)
        at file:///path/to/project/vite-jest/examples/vue-app-ts/node_modules/vite-jest/bin/vite-jest.js:11:7
        at ModuleJob.run (node:internal/modules/esm/module_job:183:25)
        at async Loader.import (node:internal/modules/esm/loader:178:24)
        at async Object.loadESM (node:internal/process/esm_loader:68:5)
        at async handleMainPromise (node:internal/modules/run_main:63:12) {
      shortMessage: 'Command failed with exit code 1: node --experimental-vm-modules /path/to/project/vite-jest/examples/vue-app-ts/node_modules/jest/bin/jest.js',
      command: 'node --experimental-vm-modules /path/to/project/vite-jest/examples/vue-app-ts/node_modules/jest/bin/jest.js',
      escapedCommand: 'node --experimental-vm-modules "/path/to/project/vite-jest/examples/vue-app-ts/node_modules/jest/bin/jest.js"',
      exitCode: 1,
      signal: undefined,
      signalDescription: undefined,
      stdout: undefined,
      stderr: undefined,
      failed: true,
      timedOut: false,
      isCanceled: false,
      killed: false
    }

Environment info

MacOS Big Sur 11.5.1

$ npm --version
7.19.1
$ node --version
v16.6.0
@imomaliev imomaliev changed the title Preset vite-jest is invalid Running examples/vue-app-ts tests throws "Preset vite-jest is invalid" Aug 3, 2021
@LaurenceM10
Copy link

Same issue here!

@cedmax
Copy link

cedmax commented Mar 22, 2023

it seems to be working with Jest v27 (I haven't tried the example, but I had the same problem in another repo and I solved it downgrading jest)

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

3 participants