title: TypeError: Descriptor for property round is non-configurable and non-writable - smart contracts
body: <p>I have multiple cloud functions for my contracts and I am trying to create some unit tests using sinon. However, I have issues when trying to simulate some of the cloud of the functions. I want just to stub them and inside the methods I have called some properties of the smart contracts and want it to return a specified value. In order to understand what am I doing, here is a code snippet of the contract (partial):</p>
  <pre><code>contract RoundOracle is Ownable, AccessControl, Pausable {
      uint8 public round; // Starts from 1. Updated after each round has finished.
  
      uint8 public constant START = 0;
      uint8 public constant END = 1;
  
      event LogSetRoundBounds(uint8 round, uint256 startRound, uint256 endRound);
  
      constructor() {
          round = 1;
      }
  }
  </code></pre>
  <p>Then I want to stub this property round and assert that its value is equal to 2, it gives me the aforementioned error. Here is the code:</p>
  <pre><code>describe(&quot;NFT Rounds Test&quot;, () =&gt; {
      context(&quot;NFT Rounds positive testing&quot;, () =&gt; {
          before(function () {
              initializeENV();
          });
      
          after(function () {
              sandbox.restore();
          });
  
          it.only(&quot;Test the web3 calls&quot;, async() =&gt; {
              console.log(&quot;hit b4 web3&quot;);
              var web = Web3.getInstance();
              console.log(&quot;hit after web3&quot;)
  
              var newSandbox = sinon.createSandbox();
              newSandbox.stub(web.roundOracle, &quot;round&quot;).value(2);
              expect(web.roundOracle.round).to.equal(2, &quot;not equal to 2&quot;);
              
              console.log(&quot;finally passed this stubbing ---&quot;);
          });
      });
  });
  </code></pre>
  <p>I understand that it is because the property is non-writable, but is it possible somehow to test such scenarios even if they are not writable or configurable?</p>