Elixir TDD tests only execute when a test file is saved

237 views Asked by At

I have a fresh installation of Laravel 5.1, and am trying to run automated tests using Elixir. According to documentation, I can run gulp tdd and have my tests execute automatically each time a file is saved. I have the initial ExampleTest.php which has this test:

public function testBasicExample()
{
    $this->visit('/')
         ->see('Laravel 5');
}

This test asserts if the default welcome.blade.php file shows Laravel 5. Each time when I save the ExampleTest.php file, the automated tests do execute, and that's great. But when I change and save the welcome.blade.php file, the tests do not execute automatically.

Is this the desired behaviour or not? If not, what could be causing it?

1

There are 1 answers

0
Ruhul Amin On BEST ANSWER

By default elixir comes with two tasks for your test suites. One for phpunit and the other for phpspec, in your gulpfile phpUnit method is called on the mix object for phpunit test suite.

mix.phpUnit();
mix.phpSpec();

And then you need to type Gulp watchfrom terminal.