title: Cypress: Getting Cypress detected that you invoked one or more cy commands in a custom command but returned a different value
body: <p>While returning any single /set of values from a function (from command.js /Page object class) getting error as &quot;Cypress detected that you invoked one or more cy commands in a custom command but returned a different value.&quot;. I have searched different options like 'Warp', '.then' but not have the luck.</p>
  <p>Following are the details:</p>
  <p><strong>My Command.js file:</strong></p>
  <pre><code>Cypress.Commands.add(&quot;getconstantvalue&quot;, () =&gt; {
      const todaysDateTime = Cypress.moment().format('MMMDDYYYYSS')
      cy.log(todaysDateTime)
      return todaysDateTime
  })
  </code></pre>
  <p>and I want this 'todaysDateTime' in my driver/describe suit script:</p>
  <pre><code>describe('The Home Page', function() {
    it('successfully loads', function() { 
      var data = cy.getconstantvalue()
      cy.log(data)       
    })
  })
  </code></pre>