LLM4UnitTests-SC is a Visual Studio Code extension designed to streamline the process of writing, validating, and testing JavaScript-based unit tests for smart contracts configured with Hardhat. With built-in LLM-assisted correction and execution features, it enhances the testing workflow by providing syntax validation, intelligent correction, code coverage analysis, and downloadable test reports—all in a unified webview interface.
How to Use
Open a JavaScript test file inside your Hardhat project.
Launch the extension by clicking the LLM4UnitTests-SC icon in the sidebar or from the Command Palette (Ctrl+Shift+P → LLM4UnitTests-SC: Start).
A webview panel will appear with the following tabs:
Syntax Validator
Correct & Revalidate
Execute Tests
Generate PDF Report
Review any detected syntax issues and apply corrections.
Execute the validated test suite and inspect code coverage.
Click Download Report to export your test summary as a PDF.