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

fix: one-line environment options #5105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hahanein
Copy link

@hahanein hahanein commented Feb 2, 2024

Description

Closes #5104

Environment options cannot be parsed when declared like so:

/** @vitest-environment-options {"url": "https://vitejs.dev"} */

The regexp captures {"url": "https://vitejs.dev"} */

I would like to add tests but I get hit with the following error message when trying to run them:

examples/graphql test: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/benjamin/projects/vitest/packages/vitest/dist/cli-wrapper.js' imported from /home/benjamin/projects/vitest/packages/vitest/vitest.mjs

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link

netlify bot commented Feb 2, 2024

Deploy Preview for fastidious-cascaron-4ded94 canceled.

Name Link
🔨 Latest commit 597d80c
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/65bd463c67d6b10008bfdb02

@hahanein hahanein changed the title Fix one-line environment options bug fix: one-line environment options Feb 2, 2024
@hi-ogawa
Copy link
Contributor

hi-ogawa commented Feb 4, 2024

I would like to add tests but I get hit with the following error message when trying to run them

Maybe you forgot pnpm dev (or pnpm build)?

vitest/CONTRIBUTING.md

Lines 16 to 22 in cfd0611

1. Run `pnpm install` in `vitest`'s root folder
2. Run `pnpm run dev` to build sources in watch mode
3. Run
- `pnpm run test` to run core tests
- `pnpm run test:all` to run all the suite

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

Successfully merging this pull request may close these issues.

Fails parsing single line environment options
2 participants