MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / isTestFile

Function isTestFile

src/extension/utils.ts:96–109  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

94}
95
96export function isTestFile(file: string): boolean {
97 // To be a test, you must be _test.dart AND inside a test folder (unless allowTestsOutsideTestFolder).
98 // https://github.com/Dart-Code/Dart-Code/issues/1165
99 // https://github.com/Dart-Code/Dart-Code/issues/2021
100 // https://github.com/Dart-Code/Dart-Code/issues/2034
101 return !!file && isDartFile(file)
102 && (
103 isInsideFolderNamed(file, "test")
104 || isInsideFolderNamed(file, "integration_test")
105 || isInsideFolderNamed(file, "test_driver")
106 || config.allowTestsOutsideTestFolder
107 )
108 && file.toLowerCase().endsWith("_test.dart");
109}
110
111// Similar to isTestFile, but requires that the file is _test.dart because it will be used as
112// an entry point for pub test running.

Callers 9

performSuiteDiscoveryMethod · 0.90
discoverTestSuitesMethod · 0.90
rebuildFromOutlineMethod · 0.90
updateEditorContextsMethod · 0.90
provideCodeLensesMethod · 0.90
provideCodeLensesMethod · 0.90
isTestFileOrFolderFunction · 0.85
isValidEntryFileFunction · 0.85

Calls 2

isDartFileFunction · 0.85
isInsideFolderNamedFunction · 0.85

Tested by

no test coverage detected