-
Notifications
You must be signed in to change notification settings - Fork 182
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
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
writeLibCairois properly awaited beforeupdateScarbTomlruns - Ensure sequential execution prevents race conditions
- Test error handling when
writeLibCairofails - Verify that
updateScarbTomldoesn't run ifwriteLibCairofails - 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.tspackages/core/cairo_alpha/src/scripts/update-scarb-project.test.ts
Related
- Original issue: Cairo: Support v3.0.0-alpha.1 #638 (review comment)
- Fix PR: Cairo: Use await async in update-scarb-project #640
Acceptance Criteria
- Tests verify
writeLibCairois awaited - Tests verify sequential execution order
- Tests handle error scenarios appropriately
- Tests follow project's Ava testing conventions
- All tests pass and provide good coverage of the async behavior
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request