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

no tests displayed with vitest 1.1.0 #206

Closed
christophsturm opened this issue Dec 24, 2023 · 10 comments
Closed

no tests displayed with vitest 1.1.0 #206

christophsturm opened this issue Dec 24, 2023 · 10 comments
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@christophsturm
Copy link

Describe the bug
when i bump the vitest dependency to 1.1.0 in the example project i no longer see tests

To Reproduce
edit package.json to use latest releases of vite and vitest:

  "devDependencies": {
    "envinfo": "^7.8.1",
    "vite": "^5.0.10",
    "vitest": "^1.1.0"
  }
  1. Go to 'testing tab in vscode'
  2. it says "no tests have been found in this workspace yet"

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Environment

(Paste info.txt content generated by the example project)

  "System": {
    "OS": "macOS 14.2.1"
  },
  "Binaries": {
    "Node": {
      "version": "21.5.0",
      "path": "/opt/homebrew/bin/node"
    },
    "Yarn": {
      "version": "1.22.19",
      "path": "/opt/homebrew/bin/yarn"
    },
    "npm": {
      "version": "10.2.4",
      "path": "/opt/homebrew/bin/npm"
    }
  },
  "IDEs": {
    "VSCode": {
      "version": "1.85.1",
      "path": "/usr/local/bin/code"
    }
  },
  "npmPackages": {
    "vite": {
      "installed": "5.0.10",
      "wanted": "^5.0.10"
    },
    "vitest": {
      "installed": "1.1.0",
      "wanted": "^1.1.0"
    }
  }
}%                         ```
@christophsturm christophsturm added the p3-minor-bug An edge case that only affects very specific usage (priority) label Dec 24, 2023
@13OnTheCode
Copy link

I'm in a similar situation too.

@watonyweng
Copy link

Hi @christophsturm, you may need to run node setup.mjs first, then append "vitest.enable": true to .vscode/settings. json file, and finally reopen VSCode.

@christophsturm christophsturm changed the title no tests displayer with vitest 1.1.0 no tests displayed with vitest 1.1.0 Dec 28, 2023
@christophsturm
Copy link
Author

that fixes it. now I just need to find out why it does not run in my monorepo.

it would be really helpful if you updated all the sample projects to vitest 1.1.0

@cyrfer
Copy link

cyrfer commented Jan 4, 2024

I just created a new monorepo, added a vitest.workspace file, and multiple packages depend on vitest. I can run vitest in the CLI with no problem, at the workspace level and for each package.

I installed this vscode extension and vscode's Testing tab shows "No tests have been found in this workspace yet" (same as OP).

I added "vitest.enable": true to .vscode/settings.json, and restarted vscode. No luck.

What is setup.mjs?

@ennioVisco
Copy link

I just created a new monorepo, added a vitest.workspace file, and multiple packages depend on vitest. I can run vitest in the CLI with no problem, at the workspace level and for each package.

I installed this vscode extension and vscode's Testing tab shows "No tests have been found in this workspace yet" (same as OP).

I added "vitest.enable": true to .vscode/settings.json, and restarted vscode. No luck.

What is setup.mjs?

They refer to this file from the sample project you should use for reproductions

@jseto
Copy link

jseto commented Jan 9, 2024

Hi @christophsturm, you may need to run node setup.mjs first, then append "vitest.enable": true to .vscode/settings. json file, and finally reopen VSCode.

Not working for me. Didn't get any message when the test fails, only the red icon.

This is the output from setup

{
  "System": {
    "OS": "Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)"
  },
  "Binaries": {
    "Node": {
      "version": "20.9.0",
      "path": "~/.nvm/versions/node/v20.9.0/bin/node"
    },
    "Yarn": "Not Found",
    "npm": {
      "version": "10.2.1",
      "path": "~/.nvm/versions/node/v20.9.0/bin/npm"
    }
  },
  "IDEs": {
    "VSCode": {
      "version": "1.85.1",
      "path": "/usr/bin/code"
    }
  },
  "npmPackages": {
    "vite": {
      "installed": "5.0.11",
      "wanted": "^5.0.11"
    },
    "vitest": {
      "installed": "1.1.3",
      "wanted": "^1.1.3"
    }
  }
}

And here is the screenshot of a failing test

image

@brion-fuller
Copy link

I believe this is similar to #198 (comment)

@jseto
Copy link

jseto commented Jan 17, 2024

I believe this is similar to #198 (comment)

Yes. It is. Sorry for not finding #198 before commenting.

@joshhsiao333
Copy link

joshhsiao333 commented Feb 1, 2024

Successful fixed by blow steps:

clone blow github repo
git clone https://github.com/zxch3n/vitest-ext-basic-example.git

Under project root, run
node setup.mjs
It will Install deps
Update Vitest extension to the latest pre-release version
Unify Vitest settings
Log env info to info.txt

if 'C:\Users\xxxx\AppData\Local\Programs\Microsoft' is not recognized as an internal or external command' error occurred. Modify line 44 of setup.mjs to
`"${code}" --install-extension zixuanchen.vitest-explorer --pre-release --force`
This will fix setup.mjs when vscode installation path contains spaces

Downgrade to v0.2.42

Open/Reload this project in VS Code
Test Vitest extension on this project.

@MilanKovacic
Copy link
Collaborator

This issue will be resolved when #213 lands.

@ffMathy ffMathy closed this as completed Feb 22, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

10 participants