This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Grails Test Runner is a VS Code extension that provides CodeLens integration for running Grails/Spock tests. It adds "Run Test" and "Rerun Test" buttons above test methods and classes in *Spec.groovy, *Tests.groovy, and *Test.groovy files, executing them via ./gradlew in the integrated terminal.
npm install— install dependenciesnpm run compile— compile TypeScript (tsc -p ./)npm run watch— auto-compile on savenpx @vscode/vsce package— build.vsixfor distribution- Press
F5in VS Code to launch the Extension Development Host for testing
There is no test framework configured for this project itself.
The extension is split into four source files under src/, compiled to out/:
-
constants.ts—CLASS_REGEXandMETHOD_REGEXused to detect Spec/Test classes and test methods in Groovy files. -
codeLensProvider.ts—GrailsTestCodeLensProviderimplementsvscode.CodeLensProvider. Parses Groovy files with regex to find Spec/Test classes andvoid "..."()test methods. Emits four CodeLens actions per scope: Run/Rerun for individual tests and for the full class. Determines test type (unit vs integration) from the file path (integration-testsubstring →integrationTesttask, otherwisetest). -
testRunner.ts—runGradleTest()builds and sends./gradlew <testType> --tests "<className>[.testName*]"to a reusable "Grails Tests" terminal. Accepts an optional--rerun-tasksflag to bypass Gradle's UP-TO-DATE cache. -
extension.ts— Entry point.activate()registers the CodeLensProvider (pattern**/*{Spec,Tests,Test}.groovy) and the four commands:runTest,runTestClass,rerunTest,rerunTestClass.
Activates on onLanguage:groovy or when the workspace contains *Spec.groovy, *Tests.groovy, or *Test.groovy files (see activationEvents in package.json).
- Comments in the source code are in Spanish.
- TypeScript strict mode is enabled.