Skip to content

Commit

Permalink
arm, fix resources mock test (#657)
Browse files Browse the repository at this point in the history
* fix spread shallow copy

* changeset
  • Loading branch information
XiaofeiCao authored Aug 6, 2024
1 parent 96c1f90 commit 44ce23e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/great-lemons-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@azure-tools/cadl-ranch-specs": patch
---

Fixed resource-manager/resources mock implementation.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ Scenarios.Azure_ResourceManager_Models_Resources_TopLevelTrackedResources_update
req.expect.deepEqual(req.body.properties, {
description: "valid2",
});
const resource = {
...validTopLevelResource,
};
const resource = JSON.parse(JSON.stringify(validTopLevelResource));
resource.properties.description = "valid2";
return {
status: 200,
Expand Down Expand Up @@ -260,9 +258,7 @@ Scenarios.Azure_ResourceManager_Models_Resources_NestedProxyResources_update = p
description: "valid2",
},
});
const resource = {
...validNestedResource,
};
const resource = JSON.parse(JSON.stringify(validTopLevelResource));
resource.properties.description = "valid2";
return {
status: 200,
Expand Down

0 comments on commit 44ce23e

Please sign in to comment.