File tree Expand file tree Collapse file tree
tests/internal/e2e/test/test_utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -560,20 +560,24 @@ export async function validateGeneratedTestScriptContent(
560560
561561 await editorView . closeAllEditors ( ) ;
562562
563- console . log ( "=== GENERATED TST SCRIPT (" + envName + ") ===" ) ;
564- console . log ( fullGenTstScript ) ;
565- console . log ( "=== EXPECTED LINES ===" ) ;
566- for ( let line of expectedTestCode ) {
567- const trimmed = line . trim ( ) ;
568- const present = fullGenTstScript . includes ( trimmed ) ;
569- if ( ! present ) {
570- console . log ( "MISSING >>> " + trimmed ) ;
571- }
572- }
563+ // Strip the TEST.NOTES: ... TEST.END_NOTES: block. Its wording is
564+ // explanatory and changed between VC releases (e.g. the "no controllable
565+ // inputs" note was reworded in vc26), so it's not something we should
566+ // assert on. Everything that matters (VALUE/STUB/structure) stays.
567+ const stripNotes = ( s ) =>
568+ s . replace ( / T E S T \. N O T E S : [ \s \S ] * ?T E S T \. E N D _ N O T E S : / g, "" ) ;
569+
570+ const genStripped = stripNotes ( fullGenTstScript ) ;
571+
572+ // expectedTestCode may be a single string or an array of lines.
573+ const expectedLines = Array . isArray ( expectedTestCode )
574+ ? expectedTestCode
575+ : stripNotes ( expectedTestCode ) . split ( "\n" ) ;
573576
574- for ( let line of expectedTestCode ) {
577+ for ( let line of expectedLines ) {
575578 line = line . trim ( ) ;
576- expect ( fullGenTstScript . includes ( line ) ) . toBe ( true ) ;
579+ if ( ! line ) continue ;
580+ expect ( genStripped . includes ( line ) ) . toBe ( true ) ;
577581 }
578582}
579583
You can’t perform that action at this time.
0 commit comments