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

feat: init @vitest/browser package #1302

Merged
merged 62 commits into from
Jul 19, 2022
Merged

feat: init @vitest/browser package #1302

merged 62 commits into from
Jul 19, 2022

Conversation

antfu
Copy link
Member

@antfu antfu commented May 13, 2022

Rework #891

Checklist

  • Init package and integration
  • Stub node packages for Vitest runtime (in progress, encounter some bug)
  • Fulfill tests (Browser only APIs, Vue and React components)
  • Better log in terminal
  • Show progress and error on the browser page
  • Headless mode in CI
  • Docs

@netlify
Copy link

netlify bot commented May 13, 2022

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 2e40c87
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/62d1c8ebcdd006000a45ec71
😎 Deploy Preview https://deploy-preview-1302--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@antfu antfu changed the title feat: @vitest/web pacakge feat: @vitest/browser pacakge May 14, 2022
@userquin userquin changed the title feat: @vitest/browser pacakge feat: @vitest/browser package May 14, 2022
@userquin
Copy link
Member

userquin commented May 14, 2022

@antfu the ui at least loading on the browser, and also the tests are loaded, but we have some problem with node:util package to format messages, I haven't found a way to bypass it, see screenshots below.

My commit also includes:

  • added root script to copy ui to browser dist on root build script
  • changes some config.web to config.browser (unresolved conversation)
  • changed vitest to vitest/browser on browser node module on /__vitest_index__ request, it was loading vitest instead the browser module
  • added isNode, isBrowser and config.browser logic to vitest modules to avoid run tests on server (fails)

imagen

imagen

@Aslemammad Aslemammad marked this pull request as ready for review July 18, 2022 12:56
@userquin
Copy link
Member

userquin commented Jul 18, 2022

Can we add a delay in the browser ui to solve it? I will check it later.

EDIT: I will add an WS ping/pong to add the ui package in the browser ui

chore: remove padding and margin and overflow hidden
chore: open browser to test/browser
pnpm-lock.yaml Outdated Show resolved Hide resolved
@antfu antfu requested a review from sheremet-va July 19, 2022 18:29
@antfu antfu changed the title feat: @vitest/browser package feat: init @vitest/browser package Jul 19, 2022
@cristian-spiescu
Copy link

cristian-spiescu commented Oct 21, 2022

Hi there! We have library that enriches the react-testing-library dev/test workflow, with visual features. We are "polishing" this lib, and we'd like to release it as open source. We currently use mocha. We are interested to use Jest/Jest compatible also, because this would fit the programming habits of more people (compared to our current setup).

That's why I find vitest-browser really interesting. Could you please share your plans/roadmap regarding this feature?

@Aslemammad
Copy link
Member

@cristian-spiescu Hey mate, Lately I've been talking to @userquin @JessicaSachs! and here's my plan:

  • Implement CI compatibility
  • Bring Proper selectors
  • More stable environment

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.

9 participants