Description
Add comprehensive tests for the updateScarbProject function in both Cairo and Cairo Alpha packages to verify proper async/await behavior and prevent race conditions.
Background
The updateScarbProject function was recently fixed in #640 to properly await asynchronous operations (writeLibCairo and updateScarbToml). Previously, these functions were called without await, causing race conditions.
Requirements
The tests should:
- Verify that
writeLibCairo is properly awaited before updateScarbToml runs
- Ensure sequential execution prevents race conditions
- Test error handling when
writeLibCairo fails
- Verify that
updateScarbToml doesn't run if writeLibCairo fails
- For cairo_alpha: ensure the git/tag format for OpenZeppelin dependency is maintained
Files to add:
packages/core/cairo/src/scripts/update-scarb-project.test.ts
packages/core/cairo_alpha/src/scripts/update-scarb-project.test.ts
Related
Acceptance Criteria
Description
Add comprehensive tests for the
updateScarbProjectfunction in both Cairo and Cairo Alpha packages to verify proper async/await behavior and prevent race conditions.Background
The
updateScarbProjectfunction was recently fixed in #640 to properly await asynchronous operations (writeLibCairoandupdateScarbToml). Previously, these functions were called without await, causing race conditions.Requirements
The tests should:
writeLibCairois properly awaited beforeupdateScarbTomlrunswriteLibCairofailsupdateScarbTomldoesn't run ifwriteLibCairofailsFiles to add:
packages/core/cairo/src/scripts/update-scarb-project.test.tspackages/core/cairo_alpha/src/scripts/update-scarb-project.test.tsRelated
Acceptance Criteria
writeLibCairois awaited