File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -40,14 +40,20 @@ function DotnetNeotestAdapter.root(path)
4040end
4141
4242function DotnetNeotestAdapter .is_test_file (file_path )
43- return (
44- (vim .endswith (file_path , " .csproj" ) or vim .endswith (file_path , " .fsproj" ))
45- and test_discovery .discover_tests (file_path )
46- )
47- or (
48- (vim .endswith (file_path , " .cs" ) or vim .endswith (file_path , " .fs" ))
49- and test_discovery .discover_tests (file_path )
50- )
43+ local isTestFile = (vim .endswith (file_path , " .csproj" ) or vim .endswith (file_path , " .fsproj" ))
44+ or (vim .endswith (file_path , " .cs" ) or vim .endswith (file_path , " .fs" ))
45+
46+ if not isTestFile then
47+ return false
48+ end
49+
50+ local tests = test_discovery .discover_tests (file_path )
51+ local n = 0
52+ if tests then
53+ n = # vim .tbl_values (tests )
54+ end
55+
56+ return tests and n > 0
5157end
5258
5359function DotnetNeotestAdapter .filter_dir (name )
You can’t perform that action at this time.
0 commit comments