No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

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

    [v1] App Extensions
    1
    4
    588
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      scelles last edited by

      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

      1 Reply Last reply Reply Quote 0
      • S
        scelles last edited by

        $ 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.

        1 Reply Last reply Reply Quote 0
        • S
          scelles last edited by scelles

          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
          
          1 Reply Last reply Reply Quote 0
          • S
            scelles last edited by

            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.
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post