Please install @quasar/quasar-app-extension-unit-jest with quasar ext --add @quasar/testing-unit-jest



  • Hello,

    I’m trying to install quasar/testing for setting unit testing with a Quasar app.

    $ npx quasar run @quasar/testing test --unit jest
     app:extension Running "@quasar/testing" Quasar App Extension... +0ms
     app:run Running "@quasar/testing" > "test" command +3ms
    
    You tried to run tests with jest, but it is not installed. Please install @quasar/quasar-app-extension-unit-jest with quasar ext --add @quasar/testing-unit-jest
    
    $ npx quasar ext --add @quasar/testing-unit-jest
     app:extension-manager Listing installed App Extensions +0ms
    
    Extension name: @quasar/testing
    Extension prompts: {
      "harnesses": [
        "unit-jest"
      ]
    }
    
    $ npx quasar run @quasar/testing test --unit jest
     app:extension Running "@quasar/testing" Quasar App Extension... +0ms
     app:run Running "@quasar/testing" > "test" command +5ms
    
    You tried to run tests with jest, but it is not installed. Please install @quasar/quasar-app-extension-unit-jest with quasar ext --add @quasar/testing-unit-jest
    

    I don’t understand why quasar/quasar-app-extension-unit-jest is not installed correctly.

    Any idea?

    Kind regards



  • $ npx quasar run @quasar/testing test --unit jest
     app:extension Running "@quasar/testing" Quasar App Extension... +0ms
     app:run Running "@quasar/testing" > "test" command +3ms
    
    You tried to run tests with jest, but it is not installed. Please install @quasar/quasar-app-extension-unit-jest with quasar ext --add @quasar/testing-unit-jest
    
    $ jest
     PASS  tests/wnb.test.js
      ✓ load sample config (63ms)
      ✓ build loads array (7ms)
      ✓ calculate center of gravity (7ms)
      ✓ inside centrogram (31ms)
    
    Test Suites: 1 passed, 1 total
    Tests:       4 passed, 4 total
    Snapshots:   0 total
    Time:        1.903s, estimated 2s
    Ran all test suites.
    

    I still don’t understand how to run my jest unit tests using Quasar.



  • I also tried with a globally install quasar-cli (ie without npx) using

    $ npm install -g @quasar/cli
    

    But I’m facing same problem

    $ quasar run @quasar/testing test --unit jest
     app:extension Running "@quasar/testing" Quasar App Extension... +0ms
     app:run Running "@quasar/testing" > "test" command +10ms
    
    You tried to run tests with jest, but it is not installed. Please install @quasar/quasar-app-extension-unit-jest with quasar ext --add @quasar/testing-unit-jest
    
    $ quasar ext --add @quasar/testing-unit-jest
     app:extension-manager Listing installed App Extensions +0ms
    
    Extension name: @quasar/testing
    Extension prompts: {
      "harnesses": [
        "unit-jest"
      ]
    }
    
    $ quasar run @quasar/testing test --unit jest
     app:extension Running "@quasar/testing" Quasar App Extension... +0ms
     app:run Running "@quasar/testing" > "test" command +4ms
    
    You tried to run tests with jest, but it is not installed. Please install @quasar/quasar-app-extension-unit-jest with quasar ext --add @quasar/testing-unit-jest
    


  • My problem was because my tests was in a tests directory instead of test/jest/__tests__/ directory

    Now tests are executing fine

    Test Suites: 2 passed, 2 total
    Tests:       10 passed, 10 total
    Snapshots:   0 total
    Time:        8.011s
    Ran all test suites.
    

Log in to reply