@@ -21,6 +21,9 @@ import childProcess, { execSync } from 'child_process';
2121
2222const samplesDir = path . join ( __dirname , '..' , 'samples' ) ;
2323
24+ // List of samples to exclude from testing.
25+ const excludedFolders = [ "js-api-loader-map" ] ;
26+
2427// Function to return all sample folders.
2528const getAllSampleFolders = ( ) => {
2629 return fs . readdirSync ( samplesDir ) . filter ( ( file ) => {
@@ -78,14 +81,17 @@ const getChangedSampleFolders = (): string[] => {
7881 const folderPath = path . join ( samplesDir , folderName ) ;
7982 return fs . existsSync ( folderPath ) && fs . statSync ( folderPath ) . isDirectory ( ) ;
8083 } ) ;
81-
84+
85+ // Filter out the samples we want to skip.
86+ validChangedFolders . filter ( folder => ! excludedFolders . includes ( folder ) ) ;
87+
8288 if ( validChangedFolders . length === 0 ) {
8389 console . warn ( "Folders were found, but none were valid sample directories. Skipping tests." ) ;
8490 console . log ( "Extracted folder names that were considered invalid:" , changedFolders ) ;
8591 console . log ( "Full output from find-changes.sh for debugging:\n" , output ) ;
8692 return [ ] ; // Fallback to do nothing
8793 }
88-
94+
8995 console . log ( "Running tests only for changed samples: " , validChangedFolders ) ;
9096 return validChangedFolders ;
9197
@@ -97,14 +103,6 @@ const getChangedSampleFolders = (): string[] => {
97103
98104// Get changed folders, filtering out excluded ones.
99105const foldersToTest = getChangedSampleFolders ( ) ;
100-
101- // Function to omit specific sample folders from testing.
102- const omitSampleFolders = ( folders : string [ ] ) : string [ ] => {
103- const excludedFolders = [
104- "js-api-loader-map" ,
105- ] ;
106- return folders . filter ( folder => ! excludedFolders . includes ( folder ) ) ;
107- } ;
108106
109107if ( foldersToTest . length === 0 ) {
110108 console . log ( "No sample folders found." ) ;
0 commit comments