@@ -5,8 +5,8 @@ import { prepareEnvironment, wait } from '../utils';
5
5
import path from 'path' ;
6
6
7
7
function getAbsolutePath ( relativePath : string ) {
8
- const scriptDir = path . dirname ( __filename ) ;
9
- return path . resolve ( scriptDir , relativePath ) ;
8
+ // Use process.cwd() which should be the project root during test execution
9
+ return path . resolve ( process . cwd ( ) , 'test/e2e/prompt-module' , relativePath ) ;
10
10
}
11
11
async function setupCommitlint ( dir : string , ver : 9 | 18 | 19 ) {
12
12
let packagePath , packageJsonPath , configPath ;
@@ -47,7 +47,7 @@ describe('cli flow to run "oco commitlint force"', () => {
47
47
`
48
48
OCO_TEST_MOCK_TYPE='prompt-module-commitlint-config' \
49
49
OCO_PROMPT_MODULE='@commitlint' \
50
- OCO_AI_PROVIDER='test' \
50
+ OCO_AI_PROVIDER='test' OCO_GITPUSH='true' \
51
51
node ${ resolve ( './out/cli.cjs' ) } commitlint force \
52
52
` ,
53
53
[ ] ,
@@ -83,7 +83,7 @@ describe('cli flow to run "oco commitlint force"', () => {
83
83
`
84
84
OCO_TEST_MOCK_TYPE='prompt-module-commitlint-config' \
85
85
OCO_PROMPT_MODULE='@commitlint' \
86
- OCO_AI_PROVIDER='test' \
86
+ OCO_AI_PROVIDER='test' OCO_GITPUSH='true' \
87
87
node ${ resolve ( './out/cli.cjs' ) } commitlint force \
88
88
` ,
89
89
[ ] ,
@@ -119,7 +119,7 @@ describe('cli flow to run "oco commitlint force"', () => {
119
119
`
120
120
OCO_TEST_MOCK_TYPE='prompt-module-commitlint-config' \
121
121
OCO_PROMPT_MODULE='@commitlint' \
122
- OCO_AI_PROVIDER='test' \
122
+ OCO_AI_PROVIDER='test' OCO_GITPUSH='true' \
123
123
node ${ resolve ( './out/cli.cjs' ) } commitlint force \
124
124
` ,
125
125
[ ] ,
@@ -160,7 +160,7 @@ describe('cli flow to generate commit message using @commitlint prompt-module',
160
160
`
161
161
OCO_TEST_MOCK_TYPE='prompt-module-commitlint-config' \
162
162
OCO_PROMPT_MODULE='@commitlint' \
163
- OCO_AI_PROVIDER='test' \
163
+ OCO_AI_PROVIDER='test' OCO_GITPUSH='true' \
164
164
node ${ resolve ( './out/cli.cjs' ) } commitlint force \
165
165
` ,
166
166
[ ] ,
@@ -175,7 +175,7 @@ describe('cli flow to generate commit message using @commitlint prompt-module',
175
175
`
176
176
OCO_TEST_MOCK_TYPE='prompt-module-commitlint-config' \
177
177
OCO_PROMPT_MODULE='@commitlint' \
178
- OCO_AI_PROVIDER='test' \
178
+ OCO_AI_PROVIDER='test' OCO_GITPUSH='true' \
179
179
node ${ resolve ( './out/cli.cjs' ) } commitlint get \
180
180
` ,
181
181
[ ] ,
@@ -193,7 +193,7 @@ describe('cli flow to generate commit message using @commitlint prompt-module',
193
193
`
194
194
OCO_TEST_MOCK_TYPE='commit-message' \
195
195
OCO_PROMPT_MODULE='@commitlint' \
196
- OCO_AI_PROVIDER='test' \
196
+ OCO_AI_PROVIDER='test' OCO_GITPUSH='true' \
197
197
node ${ resolve ( './out/cli.cjs' ) } \
198
198
` ,
199
199
[ ] ,
0 commit comments