diff --git a/docs/how-to-test-a-contract.md b/docs/how-to-test-a-contract.md index 4910c35d7..f8e653afb 100644 --- a/docs/how-to-test-a-contract.md +++ b/docs/how-to-test-a-contract.md @@ -155,6 +155,19 @@ describe('Test SmartContract `Demo`', () => { }) ``` +## Shallow Copy + +Sometimes, if you only want to do a shallow copy of some properties, you can pass in the property names as an optional argument like this: + +```ts +const nextInstance = instance.next( + { + refCloneProps: ['prop1', 'prop2'] + } +) +``` +In this context the `next` is designed to create a shallow copy of the specified properties, allowing for selective copy rather than a complete copy of the entire contract instance. + ## Run tests @@ -287,4 +300,4 @@ or ```sh npm run test:testnet -``` \ No newline at end of file +```