question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not working on macOS

See original GitHub issue

Describe the bug Maybe I didn’t use the addon in the correct way? But simply put, the addon is not working at all. After installing it, I saw the testing tab, I saw the little error beside the test, but no matter where I click, the test is not running.

To Reproduce

  1. Git clone this repository: https://github.com/zxch3n/vitest-ext-basic-example
  2. Run node setup.mjs.
  3. Open it with VSCode.
  4. Click on the arrow beside the test to start testing. Nothing happens.

Expected behavior It should start testing.

Screenshots image

Environment

{
  "System": {
    "OS": "macOS 12.4"
  },
  "Binaries": {
    "Node": {
      "version": "18.2.0",
      "path": "~/.nvm/versions/node/v18.2.0/bin/node"
    },
    "Yarn": {
      "version": "1.22.18",
      "path": "/usr/local/bin/yarn"
    },
    "npm": {
      "version": "8.9.0",
      "path": "~/.nvm/versions/node/v18.2.0/bin/npm"
    }
  },
  "IDEs": {
    "VSCode": {
      "version": "1.67.2",
      "path": "/usr/local/bin/code"
    }
  },
  "npmPackages": {
    "vite": {
      "installed": "2.9.9",
      "wanted": "^2.9.9"
    },
    "vitest": {
      "installed": "0.12.10",
      "wanted": "^0.12.6"
    }
  }
}

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
searenecommented, Jun 20, 2022

@zxch3n Hi,

After I started the 1 + 1 = 2 test by clicking here using the pre-release version

image

I got the following output:

[INFO 8:53:41 PM] Vitest Workspace [vitest-ext-basic-example]: Vitest version = 0.12.10
[INFO 8:55:01 PM] Tests run start
[INFO 8:55:01 PM] [Workspace "vitest-ext-basic-example] Run tests from workspace
[INFO 8:55:01 PM] [Execute Vitest] ./node_modules/.bin/vitest /Users/joey/WebstormProjects/vitest-ext-basic-example/add.test.ts -t add 1 + 1
[INFO 8:55:01 PM] Start api process at port 65185
[INFO 8:55:01 PM] [RUN] ./node_modules/.bin/vitest /Users/joey/WebstormProjects/vitest-ext-basic-example/add.test.ts -t add 1 + 1
[INFO 8:55:01 PM] [RUN.cwd] /Users/joey/WebstormProjects/vitest-ext-basic-example
[INFO 8:55:01 PM] WS Close
[INFO 8:55:01 PM] WS Close
[INFO 8:55:01 PM] WS Close
[INFO 8:55:02 PM] WS Close
[INFO 8:55:02 PM] WS Close
[INFO 8:55:02 PM] WS Opened
[INFO 8:55:02 PM] WS Opened
[INFO 8:55:02 PM] 

 DEV  v0.12.10 /Users/joey/WebstormProjects/vitest-ext-basic-example

      API started at http://localhost:65185



[INFO 8:55:03 PM] Vitest api process finished
[INFO 8:55:03 PM] [Workspace "vitest-ext-basic-example] Test run finished
[INFO 8:55:03 PM] Tests run end
[INFO 8:55:03 PM] WS Close
[INFO 8:55:03 PM] WS Close
[INFO 8:55:03 PM] API PROCESS EXIT
[INFO 8:55:03 PM] Vitest api process finished
[Error 8:55:03 PM] 
Failed to get any result
( Vitest should be configured to be able to run from project root )

Error when running
    ./node_modules/.bin/vitest /Users/joey/WebstormProjects/vitest-ext-basic-example/add.test.ts -t add 1 + 1

cwd: /Users/joey/WebstormProjects/vitest-ext-basic-example
node: v18.2.0

env.PATH: /Users/joey/.nvm/versions/node/v18.2.0/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/joey/.cargo/bin:/Users/joey/apps/fd:/Users/joey/.emacs.d/bin

[Error 8:55:03 PM] 

 DEV  v0.12.10 /Users/joey/WebstormProjects/vitest-ext-basic-example

      API started at http://localhost:65185



[INFO 8:55:03 PM]  ↓ add.test.ts  (1 test | 1 skipped)



Test Files  1 skipped (1)

     Tests  1 skipped (1)

      Time  909ms (in thread 0ms, Infinity%)





 PASS  Waiting for file changes...

       press h to show help, press q to quit

Seems like the test is skipped. By the way, when I ran the test manually outside of VSCode using the following command:

./node_modules/.bin/vitest /Users/joey/WebstormProjects/vitest-ext-basic-example/add.test.ts -t add 1 + 1

The test is passed as expected:

 DEV  v0.12.10 /Users/joey/WebstormProjects/vitest-ext-basic-example

 √ add.test.ts (1)

Test Files  1 passed (1)
     Tests  1 passed (1)
      Time  796ms (in thread 2ms, 39794.48%)


 PASS  Waiting for file changes...
       press h to show help, press q to quit
1reaction
zachequicommented, Aug 29, 2022

Same issue for me on linux, it looks like the websocket never connects (no WS Open message). I can confirm downgrading vitest works. Using latest vitest 0.22.1 and extension 0.2.28

Read more comments on GitHub >

github_iconTop Results From Across the Web

If your Mac doesn't turn on - Apple Support
If your Mac doesn't turn on · Check power connections · Press and hold the power button · Unplug accessories · If you...
Read more >
What to do if your MacBook is not responding? - CleanMyMac X
Solved: MacBook not responding · 1. Use Force Quit · 2. Reboot your Mac · 3. Update your Mac · 4. Clean up...
Read more >
MacBook won't turn on? Here's how to fix it - Macworld
Don't be the cliché: check that the power is on and the Mac is plugged in correctly. Or if it's a laptop, be...
Read more >
Common MacBook Problems and How to Fix Them
Try manually restarting and opening in Safe mode if possible. If there are any updates that can be applied to MacOS, try updating...
Read more >
Top 15 Problems for macOS 10.15 & How to Fix Them
13. Mac won't boot · 1. Reboot Mac and hold Command + R to go into recovery mode · 2. Release the keys...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found