Expand description
Test extraction for Go, Rust, C#, Java, Kotlin, TypeScript, JavaScript and Dart source files.
Structs§
Enums§
Constants§
- TYPESCRIPT_
TEST_ EXTENSIONS - File extensions (without the dot) of TypeScript / JavaScript (Vitest)
test files:
<name>.test.<ext>/<name>.spec.<ext>.
Functions§
- extract_
csharp_ tests - Extract C# tests (xUnit / NUnit / MSTest) from a
*.csfile: methods inside types (also through namespaces and#ifblocks) carrying a test attribute. Markers come from the comment block immediately preceding the method, andcontentruns from the first non-attribute token to the end of the method. - extract_
dart_ tests - Extract Dart (
package:test/flutter_test) tests from a*_test.dartfile:test/testWidgetscall statements directly insidemainor inside the callback of agroupthat is itself reachable that way. Markers come from the comment block immediately preceding the call, andcontentis the whole call statement. - extract_
go_ tests - Extract Go tests from a
*_test.gofile: top-levelfunction_declarations whose name starts withTest. Markers are collected from the block of comments immediately (no blank line) preceding the function. - extract_
java_ tests - Extract Java (JUnit) tests: methods annotated with one of
[
JVM_TEST_ANNOTATIONS] directly inside class / record / interface / enum bodies. Markers come from the////* */comment block immediately preceding the method;contentstarts at the first non-annotation token. - extract_
kotlin_ tests - Extract Kotlin (JUnit) tests: functions annotated with one of
[
JVM_TEST_ANNOTATIONS] at the top level or directly inside class / object / companion object bodies. Parsing uses an ASCII shadow of the source (see [KotlinShadow]); names andcontentcome from the original. - extract_
rust_ tests - Extract Rust tests:
function_items carrying a test attribute, i.e. an outer attribute whose path ends intest(#[test],#[tokio::test], …) or in one ofextra_attributes(last path segment, e.g.rstest). Markers come from the comment block immediately preceding the first (topmost) test attribute.contentis the source of thefunction_item(attributes not included). - extract_
typescript_ tests - Extract TypeScript / JavaScript (Vitest) tests from a
*.test.<ext>/*.spec.<ext>file (seeTYPESCRIPT_TEST_EXTENSIONS):it/testcall statements at the top level or directly insidedescribecallbacks. Markers come from the comment block immediately preceding the call, andcontentis the whole call statement. - is_
dart_ test_ file - Whether
pathis a Dart test file, i.e. ends with_test.dart. - is_
typescript_ test_ file - Whether
pathis a TypeScript / JavaScript (Vitest) test file, i.e. ends with.test.<ext>or.spec.<ext>for one of the supported extensions.