Skip to content

Commit

Permalink
Purging console files before starting tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deleugpn committed Mar 13, 2017
1 parent b0147ac commit c4295b4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Console/DuskCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function __construct()
public function handle()
{
$this->purgeScreenshots();
$this->purgeConsole();

$options = array_slice($_SERVER['argv'], 2);

Expand Down Expand Up @@ -103,6 +104,21 @@ protected function purgeScreenshots()
}
}

/**
* Purge console files
*
* @return void
*/
protected function purgeConsole()
{
$files = Finder::create()->files()
->in(base_path('tests/Browser/console'))
->name('*.log');

foreach ($files as $file)
@unlink($file->getRealPath());
}

/**
* Run the given callback with the Dusk configuration files.
*
Expand Down

0 comments on commit c4295b4

Please sign in to comment.