Skip to content

fix: mock browser env and set coverage to run both envs - #71

Merged
bosi95 merged 2 commits into
feat/v2from
chore/browser-test
Aug 10, 2026
Merged

fix: mock browser env and set coverage to run both envs#71
bosi95 merged 2 commits into
feat/v2from
chore/browser-test

Conversation

@bosi95

@bosi95 bosi95 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Jest test setup to exercise both Node and “browser” execution paths for unit tests by splitting unit tests into two Jest projects and adapting unit tests to provide an upload source compatible with each environment.

Changes:

  • Split unit tests into unit-node and unit-browser Jest projects, with a browser-platform setup file that forces std-env to report isNode: false.
  • Updated unit tests to use a shared makeUploadSource() helper and to skip Node-only directory-upload assertions when running under the browser project.
  • Updated test:ut to run both unit projects, and added convenience scripts for running each project individually.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/utils.ts Adds IS_BROWSER and makeUploadSource() to provide an env-appropriate upload source for unit tests.
tests/unit/trash.spec.ts Uses makeUploadSource() for uploads to work across unit-node/unit-browser.
tests/unit/file.spec.ts Uses makeUploadSource() and skips directory-upload tests in the browser project.
tests/unit/events.spec.ts Uses makeUploadSource() for uploads.
tests/unit/abort.spec.ts Uses makeUploadSource() and skips directory-upload test in the browser project.
tests/platform.browser.ts Mocks std-env to force the browser code path during unit-browser runs.
package.json Runs unit tests in both projects; adds per-project scripts.
jest.config.ts Defines unit-node and unit-browser projects sharing the same unit test match set.
eslint.config.mjs Adds Blob as a readonly global for linting.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/utils.ts
@bosi95
bosi95 merged commit 82e6908 into feat/v2 Aug 10, 2026
3 checks passed
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.

2 participants