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

Handle spawnSync errors in create-snap #1916

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

ziad-saab
Copy link
Contributor

A recent change from execSync to spawnSync didn't mock the new call properly, resulting in falsely passing tests. spawnSync doesn't throw when there's an error, it just returns an object all the time. This commit fixes the tests and the implementation to account for this difference.

A recent change from execSync to spawnSync didn't mock the new call
properly, resulting in falsely passing tests. spawnSync doesn't throw
when there's an error, it just returns an object all the time. This
commit fixes the tests and the implementation to account for this
difference.
@ziad-saab ziad-saab requested a review from a team as a code owner November 3, 2023 05:58
@ziad-saab ziad-saab requested a review from GuillaumeRx November 3, 2023 05:59
Copy link

codecov bot commented Nov 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f0d1244) 96.19% compared to head (b1aaba4) 96.19%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1916      +/-   ##
==========================================
- Coverage   96.19%   96.19%   -0.01%     
==========================================
  Files         245      245              
  Lines        5892     5888       -4     
  Branches      960      964       +4     
==========================================
- Hits         5668     5664       -4     
  Misses        224      224              
Files Coverage Δ
packages/create-snap/src/cmds/init/initUtils.ts 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@FrederikBolding FrederikBolding merged commit d533938 into main Nov 6, 2023
@FrederikBolding FrederikBolding deleted the zs/handle-spawnsync-errors branch November 6, 2023 09:52
FrederikBolding pushed a commit that referenced this pull request Nov 8, 2023
Note: merge this after #1916 

When creating a new Snap using the create-snap CLI, we make an initial
commit with the code of the template. This makes it easier for devs to
see the changes they make as they start hacking on the template, without
having to remember to make an initial commit manually.

This is similar to what's done by other "create" projects such as CRA.

Tested:

<img width="590" alt="image"
src="https://github.com/MetaMask/snaps/assets/3943143/fba9d2bd-8179-4bae-92ed-d30d0a7e937a">
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