@@ -5,8 +5,8 @@ import { prepareEnvironment, wait } from '../utils';
55import path from 'path' ;
66
77function 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 ) ;
1010}
1111async function setupCommitlint ( dir : string , ver : 9 | 18 | 19 ) {
1212 let packagePath , packageJsonPath , configPath ;
@@ -47,7 +47,7 @@ describe('cli flow to run "oco commitlint force"', () => {
4747 `
4848 OCO_TEST_MOCK_TYPE='prompt-module-commitlint-config' \
4949 OCO_PROMPT_MODULE='@commitlint' \
50- OCO_AI_PROVIDER='test' \
50+ OCO_AI_PROVIDER='test' OCO_GITPUSH='true' \
5151 node ${ resolve ( './out/cli.cjs' ) } commitlint force \
5252 ` ,
5353 [ ] ,
@@ -83,7 +83,7 @@ describe('cli flow to run "oco commitlint force"', () => {
8383 `
8484 OCO_TEST_MOCK_TYPE='prompt-module-commitlint-config' \
8585 OCO_PROMPT_MODULE='@commitlint' \
86- OCO_AI_PROVIDER='test' \
86+ OCO_AI_PROVIDER='test' OCO_GITPUSH='true' \
8787 node ${ resolve ( './out/cli.cjs' ) } commitlint force \
8888 ` ,
8989 [ ] ,
@@ -119,7 +119,7 @@ describe('cli flow to run "oco commitlint force"', () => {
119119 `
120120 OCO_TEST_MOCK_TYPE='prompt-module-commitlint-config' \
121121 OCO_PROMPT_MODULE='@commitlint' \
122- OCO_AI_PROVIDER='test' \
122+ OCO_AI_PROVIDER='test' OCO_GITPUSH='true' \
123123 node ${ resolve ( './out/cli.cjs' ) } commitlint force \
124124 ` ,
125125 [ ] ,
@@ -160,7 +160,7 @@ describe('cli flow to generate commit message using @commitlint prompt-module',
160160 `
161161 OCO_TEST_MOCK_TYPE='prompt-module-commitlint-config' \
162162 OCO_PROMPT_MODULE='@commitlint' \
163- OCO_AI_PROVIDER='test' \
163+ OCO_AI_PROVIDER='test' OCO_GITPUSH='true' \
164164 node ${ resolve ( './out/cli.cjs' ) } commitlint force \
165165 ` ,
166166 [ ] ,
@@ -175,7 +175,7 @@ describe('cli flow to generate commit message using @commitlint prompt-module',
175175 `
176176 OCO_TEST_MOCK_TYPE='prompt-module-commitlint-config' \
177177 OCO_PROMPT_MODULE='@commitlint' \
178- OCO_AI_PROVIDER='test' \
178+ OCO_AI_PROVIDER='test' OCO_GITPUSH='true' \
179179 node ${ resolve ( './out/cli.cjs' ) } commitlint get \
180180 ` ,
181181 [ ] ,
@@ -193,7 +193,7 @@ describe('cli flow to generate commit message using @commitlint prompt-module',
193193 `
194194 OCO_TEST_MOCK_TYPE='commit-message' \
195195 OCO_PROMPT_MODULE='@commitlint' \
196- OCO_AI_PROVIDER='test' \
196+ OCO_AI_PROVIDER='test' OCO_GITPUSH='true' \
197197 node ${ resolve ( './out/cli.cjs' ) } \
198198 ` ,
199199 [ ] ,
0 commit comments