Skip to content

Commit d53ba6a

Browse files
committed
rename, simplify
1 parent 1fe5cae commit d53ba6a

29 files changed

+682
-960
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
vscode-create-tests
1+
vscode-file-generator
22

33
MIT License
44

README.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# [vscode-create-tests](https://marketplace.visualstudio.com/items?itemName=hardikmodha.create-tests) (v1.1.1)
1+
# [vscode-file-generator](https://marketplace.visualstudio.com/items?itemName=hardikmodha.file-generator) (v1.1.1)
22

33
Quickly create test files for your JavaScript/Typescript/React projects with just one click.
44

5-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/HardikModha/vscode-create-tests/blob/master/LICENSE)
5+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/HardikModha/vscode-file-generator/blob/master/LICENSE)
66

77
### Motivation
88

@@ -21,35 +21,35 @@ While working on a project in my organization, We followed a pattern to keep tes
2121

2222
## How to use this extension?
2323

24-
Install and open [Visual Studio Code](https://code.visualstudio.com/). Press `Ctrl+Shift+X` or `Cmd+Shift+X` to open the Extensions pane. Type `create tests` in the search box and hit enter. You can also install the extension from the [Marketplace](https://marketplace.visualstudio.com/items?itemName=hardikmodha.create-tests). Currently, It supports Typescript and Javascript files. (Supported file extensions: `.ts`, `.tsx`, `.js`, `.jsx`)
24+
Install and open [Visual Studio Code](https://code.visualstudio.com/). Press `Ctrl+Shift+X` or `Cmd+Shift+X` to open the Extensions pane. Type `create tests` in the search box and hit enter. You can also install the extension from the [Marketplace](https://marketplace.visualstudio.com/items?itemName=hardikmodha.file-generator). Currently, It supports Typescript and Javascript files. (Supported file extensions: `.ts`, `.tsx`, `.js`, `.jsx`)
2525

2626
![Demo](https://media.giphy.com/media/1iqPhENd8SLd9SggeX/giphy.gif)
2727

2828
## Configuration options
2929

30-
| Property | Type | Default | Allowed Values | Description |
31-
| :----------------------------------- | :-------------- | :------------------------------------------------- | :---------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
32-
| `testRunner.defaultLocationForFiles` | string | `same location as source file` | 1. `same location as source file`,     2. `project root` | Location where you want to keep the test files. |
33-
| `testRunner.sourceDir` | string | `src` | any string value | Name of directory which contains all source files. This directory is not created when generating the directory structure for the test file. |
34-
| `testRunner.directoryName` | string | `tests` | any string value (allows empty string) | Name of the directory which should contain all the test files. If this config option value is set to an empty string then it keeps the test file next to the source file. |
35-
| `testRunner.customLocationForFiles` | string | - | any valid path | Set this property in case you want to specify the custom location for test files. |
36-
| `testRunner.filesSuffix` | string | 'test' | any string value | Suffix to append for every created test file |
37-
| `testRunner.shouldSwitchToFile` | boolean | true | true \| false | Whether to switch to the created test file or not |
38-
| `testRunner.template.default` | array \| object | `["import {${moduleName}} from '${modulePath}';"]` | any string array or object | Default template to use for all test file |
39-
| `testRunner.template.*` | array \| object | - | string array or object | Language specific templates that you want to use. |
30+
| Property | Type | Default | Allowed Values | Description |
31+
| :-------------------------------------- | :-------------- | :------------------------------------------------- | :---------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
32+
| `fileGenerator.defaultLocationForFiles` | string | `same location as source file` | 1. `same location as source file`,     2. `project root` | Location where you want to keep the test files. |
33+
| `fileGenerator.sourceDir` | string | `src` | any string value | Name of directory which contains all source files. This directory is not created when generating the directory structure for the test file. |
34+
| `fileGenerator.directoryName` | string | `tests` | any string value (allows empty string) | Name of the directory which should contain all the test files. If this config option value is set to an empty string then it keeps the test file next to the source file. |
35+
| `fileGenerator.customLocationForFiles` | string | - | any valid path | Set this property in case you want to specify the custom location for test files. |
36+
| `fileGenerator.filesSuffix` | string | 'test' | any string value | Suffix to append for every created test file |
37+
| `fileGenerator.shouldSwitchToFile` | boolean | true | true \| false | Whether to switch to the created test file or not |
38+
| `fileGenerator.template.default` | array \| object | `["import {${moduleName}} from '${modulePath}';"]` | any string array or object | Default template to use for all test file |
39+
| `fileGenerator.template.*` | array \| object | - | string array or object | Language specific templates that you want to use. |
4040

4141
## Template types
4242

4343
Templates are used to initialize test files with default content. It eases the task and removes boilerplate code. Following template types are supported.
4444

4545
### 1. Default template
4646

47-
The default template for any file can be specified by overriding the configuration `testRunner.template.default`.
47+
The default template for any file can be specified by overriding the configuration `fileGenerator.template.default`.
4848
Default value for this template is: `"import ${moduleName} from '${modulePath}';"` Here, `moduleName` and `modulePath` are special placeholders, which gets replaces with the source file name and the relative path to the source file respectively.
4949

5050
### 2. Language-specific templates
5151

52-
When creating the test files, this extension reads the configuration for the template specified by `testRunner.template.<file-extension>`. So if your file name is `MyFile.js` then the extension will read the configuration `testRunner.template.js` for the template. If it finds one then it will write the content of the template into the created test file.
52+
When creating the test files, this extension reads the configuration for the template specified by `fileGenerator.template.<file-extension>`. So if your file name is `MyFile.js` then the extension will read the configuration `fileGenerator.template.js` for the template. If it finds one then it will write the content of the template into the created test file.
5353

5454
**Note**: Language-specific templates have higher priority over the default template.
5555

0 commit comments

Comments
 (0)