Package Exports
- @0xcompose/sspec
- @0xcompose/sspec/bin/src/index.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@0xcompose/sspec) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
sspec
sspec comes from Solidity SPECification
. Smart contract repositories often lack detailed or even general descriptions of what the repo and its smart contracts do. Only AIs can understand what's going on (not always). This tool was created to improve development and review simplicity.
This is a reimagining of scopelint
's spec
command, which generates specifications for source smart contracts based on test files and test names.
This functionality helps not only with understanding your own test suites, but also with reviewing other repositories.
Built using slang.
Installation
Install via npm or yarn:
npm i @0xcompose/sspec --save-dev
yarn add @0xcompose/sspec --dev
Foundry Test Naming Conventions
There are three valid naming conventions for unit testing (according to Foundry best practices):
Testing whole contract:
- Test file:
SourceContractName.t.sol
- Test contract:
SourceContractNameTest
- Test file:
Testing single function:
- Test file:
SourceContractName.sourceFunctionName.t.sol
- Test contract:
SourceFunctionName
(in PascalCase)
- Test file:
Testing features:
- Test file:
SourceContractName.FeatureName.t.sol
- Test contract:
FeatureName
- Note: Feature can be anything, including integration tests
- Test file: