-
Notifications
You must be signed in to change notification settings - Fork 11
Replace Karma/Jasmine with Vitest in nimble-components #2766
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
base: main
Are you sure you want to change the base?
Conversation
| @@ -0,0 +1,31 @@ | |||
| # mac-test-reliability-fixes Development Guidelines | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm planning to remove all of the .github, .specify, and .vscode changes - so please ignore
This ensures that when Vitest is invoked via npm workspaces from the monorepo root, all file paths are resolved relative to the package directory instead of the monorepo root, preventing absolute filesystem URLs in the Vite dev server.
- Add 60s browser launch timeout to playwright provider - Add hookTimeout configuration for better error handling - Enable server warmup for test files to reduce connection failures - Disable slowHijackESM to reduce iframe connection issues - Add GitHub Actions artifact upload for Vitest failure screenshots
| @@ -0,0 +1,31 @@ | |||
| # mac-test-reliability-fixes Development Guidelines | |||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not planning to review this PR any time soon since it's enormous and the outcome isn't high priority, but please let me know if you think it should be.
- Add 30 minute timeout to build job to prevent hung tests - Set base path to './' to fix absolute filesystem URLs in CI - Allow parent directory access for node_modules resolution
Analysis shows we've been going in circles with path configurations. Created vitest-ci-debugging-history.md to track all attempted fixes. New approach: - Remove 'base' config entirely - let Vite auto-detect - Disable HMR in CI to prevent module resolution issues - Keep process.chdir() for working directory consistency This is a different angle - HMR can cause issues with module resolution in headless browser environments.
Previous attempt with base: './' and no base both failed. Testing if explicit base: '/' helps Vite construct proper URLs. Updated debugging history with Attempt 8 and 9.
Pull Request
🤨 Rationale
@ni/nimble-componentstests execute faster, in more browsers, and with better tooling.👩💻 Implementation
vitest.config.ts, and wired up scripts for Chromium, Firefox, WebKit, coverage, and UI mode.setup-vitest.ts, async utilities, spy helpers, fake timers, etc.).nimble-componentsspec suite to Vitest expectations (spies, matchers, timers, custom helpers) and converted all components.@vitest/browseroverrides,npm run test:vitest:firefox, andnpm run test:vitest:webkit, then fixing the failing cases across the suite.test:vitest→test, refreshed documentation, and generated the beachball change file.🧪 Testing
npm run testnpm run test:vitest:firefoxnpm run test:vitest:webkitnpm run test:vitest:coveragenpm run test:vitest:uinpm run test)npm run lint✅ Checklist