@10up/cypress-wp-utils
    Preparing search index...

    Function wpCliEval

    • Run PHP code as WP CLI eval-file command

      Parameters

      • command: string

        PHP code to execute with WP CLI. The '<?php ' prefix is optional.

      Returns void

      cy.wpCliEval('<?php for($i=0; $i<10; $i++) { echo $i; }').then(response=>{
      const output = response.stdout;
      // Do whatever with the output.
      })