@@ -11,7 +11,7 @@ export const GITLAB_API_URL = process.env.GITLAB_API_URL;
1111export const GITLAB_PROJECT_ID = process . env . GITLAB_PROJECT_ID ; // Only for DEFAULT_PROJECT tests
1212
1313if ( ! GITLAB_TOKEN || ! GITLAB_API_URL ) {
14- console . warn ( ' ⚠️ GITLAB_TOKEN and GITLAB_API_URL are required for integration tests' ) ;
14+ console . warn ( " ⚠️ GITLAB_TOKEN and GITLAB_API_URL are required for integration tests" ) ;
1515}
1616
1717// Test data state interface
@@ -31,14 +31,15 @@ export interface TestDataState {
3131 mergeRequests ?: any [ ] ;
3232 milestones ?: any [ ] ;
3333 labels ?: any [ ] ;
34+ todos ?: any [ ] ;
3435}
3536
36- import * as fs from 'fs' ;
37- import * as path from ' path' ;
38- import * as os from 'os' ;
37+ import * as fs from "fs" ;
38+ import * as path from " path" ;
39+ import * as os from "os" ;
3940
4041// Use persistent file storage to share data across test files (Jest creates separate contexts)
41- const TEST_DATA_FILE = path . join ( os . tmpdir ( ) , ' gitlab-mcp-test-data.json' ) ;
42+ const TEST_DATA_FILE = path . join ( os . tmpdir ( ) , " gitlab-mcp-test-data.json" ) ;
4243
4344// Use global state to share data across all test files in the same Jest process
4445declare global {
@@ -59,12 +60,12 @@ export const getTestData = (): TestDataState => {
5960 // Fall back to persistent file (for cross-file sharing)
6061 try {
6162 if ( fs . existsSync ( TEST_DATA_FILE ) ) {
62- const data = JSON . parse ( fs . readFileSync ( TEST_DATA_FILE , ' utf8' ) ) ;
63+ const data = JSON . parse ( fs . readFileSync ( TEST_DATA_FILE , " utf8" ) ) ;
6364 global . TEST_DATA_STATE = data ; // Cache in global state
6465 return data ;
6566 }
6667 } catch ( error ) {
67- console . warn ( ' ⚠️ Could not read test data file:' , error ) ;
68+ console . warn ( " ⚠️ Could not read test data file:" , error ) ;
6869 }
6970
7071 return { } ;
@@ -76,7 +77,7 @@ export const setTestData = (data: TestDataState): void => {
7677 try {
7778 fs . writeFileSync ( TEST_DATA_FILE , JSON . stringify ( global . TEST_DATA_STATE , null , 2 ) ) ;
7879 } catch ( error ) {
79- console . warn ( ' ⚠️ Could not write test data file:' , error ) ;
80+ console . warn ( " ⚠️ Could not write test data file:" , error ) ;
8081 }
8182} ;
8283
@@ -86,7 +87,7 @@ export const updateTestData = (updates: Partial<TestDataState>): void => {
8687 try {
8788 fs . writeFileSync ( TEST_DATA_FILE , JSON . stringify ( global . TEST_DATA_STATE , null , 2 ) ) ;
8889 } catch ( error ) {
89- console . warn ( ' ⚠️ Could not write test data file:' , error ) ;
90+ console . warn ( " ⚠️ Could not write test data file:" , error ) ;
9091 }
9192} ;
9293
@@ -95,7 +96,7 @@ export const requireTestData = () => {
9596 const data = getTestData ( ) ;
9697 if ( ! data . project ?. id || ! data . group ?. id ) {
9798 throw new Error (
98- ' Test data not available. Make sure to run data-lifecycle.test.ts first with --runInBand'
99+ " Test data not available. Make sure to run data-lifecycle.test.ts first with --runInBand"
99100 ) ;
100101 }
101102 return data ;
@@ -109,4 +110,4 @@ export const getTestProject = () => {
109110export const getTestGroup = ( ) => {
110111 const data = requireTestData ( ) ;
111112 return data . group ;
112- } ;
113+ } ;
0 commit comments