Run both Grunt and Codeception in a Laravel project

In my Laravel project I use Grunt for testing and building client-side code and Codeception to run my acceptance tests. It might be possible to trigger Grunt from Codeception, but I don’t know how. However, to run Codeception from Grunt you should just install the grunt-shell plugin and add the following lines to your Gruntfile.js:

shell: {
  codeCeption: {
    options: {
      stdout: true
    },
    command: 'php codecept.phar run'
  }
 }
 

See also:

2 thoughts on “Run both Grunt and Codeception in a Laravel project

  1. If you want grunt to fail if a codeception test fails you need to add the failOnError: true option like and I think the –report flag for the command:

    shell: {
          codeCeption: {
            options: {
              stdout: true,
              failOnError: true
            },
            command: 'php codecept.phar run --report'
          }
        },

Leave a Reply

Your email address will not be published. Required fields are marked *