1
1
const { expect } = require ( 'chai' ) ;
2
2
const sinon = require ( 'sinon' ) ;
3
- const fs = require ( 'fs' ) ;
4
3
const path = require ( 'path' ) ;
5
- const { spawnSync } = require ( 'child_process' ) ;
6
4
const { exec } = require ( '../../src/proxy/processors/push-action/preReceive' ) ;
7
5
8
6
describe ( 'Pre-Receive Hook Execution' , function ( ) {
@@ -29,7 +27,6 @@ describe('Pre-Receive Hook Execution', function () {
29
27
} ) ;
30
28
31
29
it ( 'should execute hook successfully' , async ( ) => {
32
- const path = require ( 'path' ) ;
33
30
const scriptPath = path . resolve ( __dirname , 'pre-receive-hooks/always-allow.sh' ) ;
34
31
35
32
const result = await exec ( req , action , scriptPath ) ;
@@ -42,7 +39,6 @@ describe('Pre-Receive Hook Execution', function () {
42
39
} ) ;
43
40
44
41
it ( 'should fail when hook file does not exist' , async ( ) => {
45
- const path = require ( 'path' ) ;
46
42
const scriptPath = path . resolve ( __dirname , 'pre-receive-hooks/missing-hook.sh' ) ;
47
43
48
44
const result = await exec ( req , action , scriptPath ) ;
@@ -55,7 +51,6 @@ describe('Pre-Receive Hook Execution', function () {
55
51
} ) ;
56
52
57
53
it ( 'should fail when hook execution returns an error' , async ( ) => {
58
- const path = require ( 'path' ) ;
59
54
const scriptPath = path . resolve ( __dirname , 'pre-receive-hooks/always-reject.sh' ) ;
60
55
61
56
const result = await exec ( req , action , scriptPath ) ;
0 commit comments