Skip to content

test: improve coverage for toDatasetAttrs by refactoring to html-utils#52

Closed
zknpr wants to merge 1 commit intomainfrom
test-improvement-todatasetattrs-5188204892513283198
Closed

test: improve coverage for toDatasetAttrs by refactoring to html-utils#52
zknpr wants to merge 1 commit intomainfrom
test-improvement-todatasetattrs-5188204892513283198

Conversation

@zknpr
Copy link
Copy Markdown
Owner

@zknpr zknpr commented Feb 7, 2026

This PR addresses a testing gap for the toDatasetAttrs function in src/helpers.ts.
Previously, src/helpers.ts imported vscode at the top level, making it difficult to unit test pure functions within it using the Node.js test runner.

Changes:

  1. Refactoring: Extracted toDatasetAttrs, toBoolString, and internal toDashCase helper to a new file src/html-utils.ts. This file has no dependencies on vscode.
  2. Testing: Added tests/unit/html-utils.test.ts with 100% coverage for the extracted functions.
  3. Compatibility: src/helpers.ts now re-exports these functions, ensuring no breaking changes for existing consumers.
  4. Housekeeping: package-lock.json was updated to sync with package.json version 1.2.7.

Tests passed:

  • tests/unit/html-utils.test.ts: 10/10 tests passed.
  • All other tests passed.

PR created automatically by Jules for task 5188204892513283198 started by @zknpr

- Refactored `toDatasetAttrs`, `toBoolString`, and `toDashCase` from `src/helpers.ts` to a new `src/html-utils.ts` module to remove dependency on `vscode` module during testing.
- Added comprehensive unit tests in `tests/unit/html-utils.test.ts`.
- Updated `src/helpers.ts` to re-export the utilities to maintain backward compatibility.
- Updated `package-lock.json` to match `package.json` version (1.2.7).

Co-authored-by: zknpr <96851588+zknpr@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Feb 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sq-lite-explorer Ready Ready Preview, Comment Feb 7, 2026 2:00pm

@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@zknpr
Copy link
Copy Markdown
Owner Author

zknpr commented Feb 7, 2026

Merged as part of v1.3.0 release in PR #65

@zknpr zknpr closed this Feb 7, 2026
@google-labs-jules
Copy link
Copy Markdown
Contributor

Merged as part of v1.3.0 release in PR #65

Acknowledged. Glad to see the improvements included in the release!

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.

1 participant