honojs / hono

Web framework built on Web Standards
https://hono.dev
MIT License
18.93k stars 538 forks source link

chore(test): cover jsx attributes #3452

Open exoego opened 4 days ago

exoego commented 4 days ago

This PR is going to cover jsx-runtime.ts file which is covered 0% now.

https://app.codecov.io/github/honojs/hono/blob/main/src%2Fjsx%2Fjsx-runtime.ts image

The author should do the following, if applicable

codecov[bot] commented 4 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.58%. Comparing base (f87c221) to head (c19c963). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3452 +/- ## ======================================= Coverage 95.58% 95.58% ======================================= Files 155 155 Lines 9357 9357 Branches 2779 2843 +64 ======================================= Hits 8944 8944 Misses 413 413 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

exoego commented 4 days ago

Hmm, I thought this PR can improve coverage on https://app.codecov.io/gh/honojs/hono/pull/3452/blob/src/jsx/jsx-runtime.ts#L43 but no changes ... 🤔

usualoma commented 2 days ago

Hi @exoego.

Thank you for creating the pull request.

jsxAttr is a function used when Deno's “jsx”: “precompile” is used, and unit tests are run as follows. https://github.com/usualoma/hono/blob/ebf9ea769bb638f4a12d553ec3ead3f3204a04e3/runtime-tests/deno-jsx/jsx.test.tsx#L114-L166

It would be good if we could reflect the coverage of Deno's runtime-tests, but as you can see from the following pull request, it's not as straightforward as it seems, and it's not currently being refrected. https://github.com/honojs/hono/pull/3456