File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,14 @@ func IsInTestFolder(path string, testsPath string) bool {
8383func IsCommonTestFolder (path string ) bool {
8484 testPaths := [3 ]string {"test" , "e2e" , "__tests__" }
8585
86- for _ , element := range testPaths {
87- if strings .Contains (path , string (os .PathSeparator )+ element ) {
86+ for _ , testPath := range testPaths {
87+ // Here, we want to do 2 things:
88+ // - Exclude the `testPath` itself, i.e. check for a path that ends e.g. with "/e2e"
89+ // - Exclude any file in it, i.e. check for path that contains e.g. "/e2e/"
90+ testFolderPath := string (os .PathSeparator ) + testPath
91+ fileInTestFolderPath := testFolderPath + string (os .PathSeparator )
92+
93+ if strings .HasSuffix (path , testFolderPath ) || strings .Contains (path , fileInTestFolderPath ) {
8894 if ! didPrintDefaultTestFoldersMsg {
8995 log .Info ("\t Ignoring common test folders (such as `e2e`)" )
9096 didPrintDefaultTestFoldersMsg = true
You can’t perform that action at this time.
0 commit comments