Spec/Test files are a common task between developers. This extension is just about quick create those files based on the the opened one and save you of typing or copy&paste the name during the creation. :)
This extension is available for free in the Visual Studio Code Marketplace
- Open Extensions sidebar panel in VS Code.
View → Extensions
; - Search for
Quick Spec
; - Click Install to install it.
With a file opened, just open the Command Palette
(View -> Command Palette) and search for Quick Spec: create
.
In a nutshell, it'll copy the opened file name and create a new one with the same name but inserting .test
.
To customize how the files are generate, go to User Settings (Code → Preferences → Settings
) and search for Quick Spec
.
name | Default | Description | example |
---|---|---|---|
quickSpec.defaultExtension |
.test |
Spec extension which will be applied for all kind of file extension |
"quickSpec.defaultExtension": ".spec" |
quickSpec.extensionPerLanguage |
{} |
Object which accepts file extension (key) and the test extension (value). This is for when you want to create a specific test only for one kind of file | "quickSpec.extensionPerLanguage": { ".go": ".spec" } |