File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -94,10 +94,8 @@ describe('Schema Generation Script', () => {
9494 expect ( content ) . toContain ( '*/' ) ;
9595 expect ( content ) . toContain ( 'export' ) ;
9696 expect ( content ) . toContain ( 'DO NOT EDIT MANUALLY' ) ;
97- // Match timestamp with flexible whitespace/line breaks (handle Windows \r\n)
98- expect ( content ) . toMatch (
99- / G e n e r a t e d o n : [ \s \r \n ] * \d { 4 } - \d { 2 } - \d { 2 } T \d { 2 } : \d { 2 } : \d { 2 } \. \d { 3 } Z /
100- ) ;
97+ // Match timestamp that may be on the next line after "Generated on:"
98+ expect ( content ) . toMatch ( / G e n e r a t e d o n : [ \s \r \n * ] * \d { 4 } - \d { 2 } - \d { 2 } T \d { 2 } : \d { 2 } : \d { 2 } \. \d { 3 } Z / ) ;
10199 } ) ;
102100 } ) ;
103101
@@ -263,7 +261,7 @@ describe('Schema Generation Script', () => {
263261 files . forEach ( ( file ) => {
264262 const content = readFileSync ( join ( GENERATED_DIR , file ) , 'utf8' ) ;
265263 const timestampMatch = content . match (
266- / G e n e r a t e d o n : [ \s \r \n ] * ( \d { 4 } - \d { 2 } - \d { 2 } T \d { 2 } : \d { 2 } : \d { 2 } \. \d { 3 } Z ) /
264+ / G e n e r a t e d o n : [ \s \r \n * ] * ( \d { 4 } - \d { 2 } - \d { 2 } T \d { 2 } : \d { 2 } : \d { 2 } \. \d { 3 } Z ) /
267265 ) ;
268266
269267 expect ( timestampMatch ) . toBeTruthy ( ) ;
Original file line number Diff line number Diff line change @@ -139,14 +139,16 @@ describe('PathUtils', () => {
139139 const result = PathUtils . findCommonBase ( paths ) ;
140140 // Normalize path separators for cross-platform compatibility
141141 const normalizedResult = result . replace ( / \\ / g, '/' ) ;
142- expect ( normalizedResult ) . toBe ( '/project' ) ;
142+ // On Windows, absolute paths may include drive letters
143+ expect ( normalizedResult ) . toMatch ( / ^ ( [ A - Z ] : ) ? \/ p r o j e c t $ / ) ;
143144 } ) ;
144145
145146 it ( 'should handle single path' , ( ) => {
146147 const result = PathUtils . findCommonBase ( [ '/project/docs/file.md' ] ) ;
147148 // Normalize path separators for cross-platform compatibility
148149 const normalizedResult = result . replace ( / \\ / g, '/' ) ;
149- expect ( normalizedResult ) . toBe ( '/project/docs' ) ;
150+ // On Windows, absolute paths may include drive letters
151+ expect ( normalizedResult ) . toMatch ( / ^ ( [ A - Z ] : ) ? \/ p r o j e c t \/ d o c s $ / ) ;
150152 } ) ;
151153
152154 it ( 'should handle empty array' , ( ) => {
You can’t perform that action at this time.
0 commit comments