This repository was archived by the owner on Mar 31, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +25
-50
lines changed Expand file tree Collapse file tree 3 files changed +25
-50
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,12 @@ var gulp = require('gulp');
2
2
var Elixir = require ( 'laravel-elixir' ) ;
3
3
4
4
var config = Elixir . config ;
5
- var notify = new Elixir . Notification ( ) ;
5
+ var runTests = require ( './shared/Tests.js' ) ;
6
+
6
7
7
8
/*
8
9
|----------------------------------------------------------------
9
- | PHPUnit Testing
10
+ | PHPSpec Testing
10
11
|----------------------------------------------------------------
11
12
|
12
13
| This task will trigger your entire PHPUnit test suite and it
@@ -16,24 +17,10 @@ var notify = new Elixir.Notification();
16
17
*/
17
18
18
19
Elixir . extend ( 'phpSpec' , function ( src , command ) {
19
- src = src || ( config . testing . phpSpec . path + '/**/*Spec.php' ) ,
20
- command = command || 'vendor/bin/phpspec run' ;
21
-
22
- new Elixir . Task ( 'phpSpec' , function ( error ) {
23
- Elixir . Log . heading ( 'Triggering PHPSpec: ' + command ) ;
24
-
25
- return (
26
- gulp
27
- . src ( '' )
28
- . pipe ( Elixir . Plugins . shell ( command ) )
29
- . on ( 'error' , function ( e ) {
30
- notify . forFailedTests ( e , 'PHPSpec' ) ;
31
-
32
- this . emit ( 'end' ) ;
33
- } )
34
- . pipe ( notify . forPassedTests ( 'PHPSpec' ) )
35
- ) ;
36
- } )
37
- . watch ( src ) ;
20
+ runTests (
21
+ 'PHPSpec' ,
22
+ src || ( config . testing . phpSpec . path + '/**/*Spec.php' ) ,
23
+ command || 'vendor/bin/phpspec run'
24
+ ) ;
38
25
} ) ;
39
26
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ var gulp = require('gulp');
2
2
var Elixir = require ( 'laravel-elixir' ) ;
3
3
4
4
var config = Elixir . config ;
5
- var notify = new Elixir . Notification ( ) ;
5
+ var runTests = require ( './shared/Tests.js' ) ;
6
+
6
7
7
8
/*
8
9
|----------------------------------------------------------------
@@ -16,24 +17,10 @@ var notify = new Elixir.Notification();
16
17
*/
17
18
18
19
Elixir . extend ( 'phpUnit' , function ( src , command ) {
19
- src = src || ( config . testing . phpUnit . path + '/**/*Test.php' ) ;
20
- command = command || 'vendor/bin/phpunit --verbose' ;
21
-
22
- new Elixir . Task ( 'phpUnit' , function ( error ) {
23
- Elixir . Log . heading ( 'Triggering PHPUnit: ' + command ) ;
24
-
25
- return (
26
- gulp
27
- . src ( '' )
28
- . pipe ( Elixir . Plugins . shell ( command ) )
29
- . on ( 'error' , function ( e ) {
30
- notify . forFailedTests ( e , 'PHPUnit' ) ;
31
-
32
- this . emit ( 'end' ) ;
33
- } )
34
- . pipe ( notify . forPassedTests ( 'PHPUnit' ) )
35
- ) ;
36
- } )
37
- . watch ( src ) ;
20
+ runTests (
21
+ 'PHPUnit' ,
22
+ src || ( config . testing . phpUnit . path + '/**/*Test.php' ) ,
23
+ command || 'vendor/bin/phpunit --verbose'
24
+ ) ;
38
25
} ) ;
39
26
Original file line number Diff line number Diff line change @@ -3,23 +3,24 @@ var Elixir = require('../../index');
3
3
4
4
var notify = new Elixir . Notification ( ) ;
5
5
6
- module . exports = function ( options ) {
7
- new Elixir . Task ( options . name , function ( ) {
8
- this . log ( options . src ) ;
6
+ module . exports = function ( name , src , command ) {
7
+ new Elixir . Task ( name , function ( error ) {
8
+ Elixir . Log . heading ( 'Triggering ' + name + ': ' + command ) ;
9
9
10
10
return (
11
11
gulp
12
- . src ( options . src )
13
- . pipe ( options . plugin ( '' , options . pluginOptions ) )
12
+ . src ( '' )
13
+ . pipe ( Elixir . Plugins . shell ( command ) )
14
14
. on ( 'error' , function ( e ) {
15
- notify . forFailedTests ( e , options . name ) ;
15
+ notify . forFailedTests ( e , name ) ;
16
16
17
17
this . emit ( 'end' ) ;
18
18
} )
19
- . pipe ( notify . forPassedTests ( options . name ) )
19
+ . pipe ( notify . forPassedTests ( name ) )
20
20
) ;
21
21
} )
22
- . watch ( options . src , 'tdd' )
22
+ . watch ( src )
23
23
. watch ( Elixir . config . appPath + '/**/*.php' , 'tdd' )
24
- . watch ( Elixir . config . viewPath + '/**/*.php' , 'tdd' )
24
+ . watch ( Elixir . config . viewPath + '/**/*.php' , 'tdd' ) ;
25
25
} ;
26
+
You can’t perform that action at this time.
0 commit comments