Conversation
9d5f81c to
9a32dd8
Compare
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
- Run the test on real browsers in the CI. - Added helpers to run tests. - Added a lambdatest helper.
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the testing infrastructure by migrating from Vitest v3 to v4, implementing browser-based testing with WebDriverIO, and adding LambdaTest integration for cross-browser testing in CI/CD.
Key changes include:
- Migration to Vitest v4 with separate Node.js and browser test projects
- Addition of WebDriverIO-based browser testing with support for Chrome, Firefox, Edge, and Safari
- Integration with LambdaTest for cloud-based cross-browser testing
- Replacement of
self.fetchwithglobalThis.fetchfor better cross-environment compatibility
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Adds comprehensive browser testing configuration with WebDriverIO provider and LambdaTest support |
| src/ui/UIMetrics.browser.spec.ts | New browser-specific test for UIMetrics component |
| src/Util.ts | Updates fetch implementation to use globalThis instead of self |
| src/Util.spec.ts | Updates tests for globalThis.fetch and adds browser environment compatibility |
| src/EventEmitter.spec.ts | Adds mockClear to prevent test interference |
| src/Connect.spec.ts | Updates invalid URL test case |
| scripts/run-lambdatest.ts | New script for managing LambdaTest browser matrix selection and test execution |
| package.json | Updates dependencies to Vitest v4 and adds browser testing packages |
| .husky/pre-push | Updates to use new test script |
| .gitignore | Adds test-related ignore patterns |
| .github/workflows/test.yaml | New GitHub Actions workflow for matrix testing across browsers and platforms |
| .github/workflows/test-node.yml | Removed in favor of new test.yaml workflow |
| .codecov.yml | Removes comment configuration |
Comments suppressed due to low confidence (1)
src/Util.spec.ts:310
- The
describeblocks 'path functions' and 'string trim functions' are incorrectly nested inside theit('should throw on error response')test at line 260. This will cause these test suites to never execute. Thesedescribeblocks should be moved outside and at the same level as the 'fetch' describe block.
describe('path functions', () => {
it('should get extension from path', () => {
expect(Util.getExtension('file.txt')).toBe('.txt');
expect(Util.getExtension('path/to/file.txt')).toBe('.txt');
expect(Util.getExtension('file')).toBe('');
expect(Util.getExtension('path/to/file.txt')).toBe('.txt');
expect(Util.getExtension('path/to/.txt')).toBe('.txt');
expect(Util.getExtension('.txt')).toBe('.txt');
expect(Util.getExtension('path/to/file.txt.')).toBe('.');
});
it('should get file from path', () => {
expect(Util.getFile('file.txt')).toBe('file.txt');
expect(Util.getFile('path/to/file.txt')).toBe('file.txt');
});
it('should get base file without extension', () => {
expect(Util.getBaseFile('file.txt')).toBe('file');
expect(Util.getBaseFile('path/to/file.txt')).toBe('file');
expect(Util.getBaseFile('file')).toBe('file');
});
});
describe('string trim functions', () => {
it('should trim spaces', () => {
expect(Util.trim(' hello ')).toBe('hello');
});
it('should trim custom characters', () => {
expect(Util.trim('xxhelloxx', 'x')).toBe('hello');
expect(Util.trim('xxhello😭xx', 'x😭')).toBe('hello');
});
it('should trim start only', () => {
expect(Util.trimStart(' hello ')).toBe('hello ');
expect(Util.trimStart('😭hello😭', '😭')).toBe('hello😭');
});
it('should trim end only', () => {
expect(Util.trimEnd(' hello ')).toBe(' hello');
expect(Util.trimEnd('😭hello😭', '😭')).toBe('😭hello');
});
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.