File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,25 @@ describe('git-hook runner', function () {
9696 } ) ;
9797 } ) ;
9898
99+ describe ( 'more than one in known order' , function ( ) {
100+ var hooks = [ '03.foo' , '01.bar' , '02.baz' ] ;
101+ beforeEach ( function ( ) {
102+ var logFile = SANDBOX_PATH + 'ordered.log' ;
103+ hooks . forEach ( function ( name ) {
104+ createHook ( PROJECT_PRECOMMIT_HOOK + name , 'echo ' + name + '>> ' + logFile ) ;
105+ } ) ;
106+ } ) ;
107+
108+ it ( 'should run it one by one in known order' , function ( done ) {
109+ gitHooks . run ( PRECOMMIT_HOOK_PATH , [ ] , function ( code ) {
110+ code . should . equal ( 0 ) ;
111+ var logFile = SANDBOX_PATH + 'ordered.log' ;
112+ fs . readFileSync ( logFile ) . toString ( ) . should . equal ( hooks . sort ( ) . join ( '\n' ) + '\n' ) ;
113+ done ( ) ;
114+ } ) ;
115+ } ) ;
116+ } ) ;
117+
99118 describe ( 'and work without errors' , function ( ) {
100119 var logFile = SANDBOX_PATH + 'hello.log' ;
101120 beforeEach ( function ( ) {
You can’t perform that action at this time.
0 commit comments