Skip to content
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

fix(public-assets): mock readAsset promise properly #851

Merged
merged 2 commits into from
Jan 19, 2023

Conversation

harlan-zw
Copy link
Contributor

@harlan-zw harlan-zw commented Jan 19, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

import { readAsset } from '#internal/nitro/virtual/public-assets'

// throws error within readAsset
const file = readAsset('my-file')

Results in the following error when pre-rendering undefined is not a promise

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Jan 19, 2023

Codecov Report

Merging #851 (0833dcf) into main (bce44da) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##             main     #851   +/-   ##
=======================================
  Coverage   67.34%   67.34%           
=======================================
  Files          58       58           
  Lines        5748     5748           
  Branches      611      611           
=======================================
  Hits         3871     3871           
  Misses       1869     1869           
  Partials        8        8           
Impacted Files Coverage Ξ”
src/rollup/plugins/public-assets.ts 91.73% <0.00%> (ΓΈ)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Thanks!

@pi0 pi0 merged commit 686a560 into nitrojs:main Jan 19, 2023
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