https://github.com/devtin/ava-to-json
Converts AVA tests syntax into JSON
https://github.com/devtin/ava-to-json
Last synced: about 1 year ago
JSON representation
Converts AVA tests syntax into JSON
- Host: GitHub
- URL: https://github.com/devtin/ava-to-json
- Owner: devtin
- Created: 2020-05-25T13:42:05.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T06:57:15.000Z (about 3 years ago)
- Last Synced: 2024-04-24T11:11:31.785Z (almost 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 835 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# ava2json
[](https://github.com/devtin/ava-to-json/actions)
* [ava2json](#user-content-module_ava2json)
* _Methods_
* [parseAva(avaString, [options])](#user-content-module_ava2json..parseAva)
* [parseFile(file, [options])](#user-content-module_ava2json..parseFile)
* [parseFileSync(file, [options])](#user-content-module_ava2json..parseFileSync)
* _Other_
* [AvaTest](#user-content-module_ava2json..AvaTest)
### ava2json~AvaTest
**Properties**
| Name | Type | Description |
| --- | --- | --- |
| title | String | The AVA test title wrapped inside of the test function |
| description | String | The feature description (if any) added above the test as a JSDoc comment |
| code | String | The code found wrapped in the test function. |
| flag | String | Either `'skip'`, `'only'`, `'todo'` or `null` for none; |
### ava2json~parseAva(avaString, [options])
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| avaString | String | | The source of the AVA test file |
| [options] | Object | | |
| [options.unIndent] | Number | 2 | Positive integer in which the code will be un-indented |
| [options.testName] | String | test | The name of the test function to look-up into the code |
**Returns**: Array.<AvaTest> - The tests found in the source code
Parses given AVA test source code
### ava2json~parseFile(file, [options])
| Param | Type | Description |
| --- | --- | --- |
| file | String | Path to the AVA file |
| [options] | Object | Same options as in [parseAva](parseAva) |
Parses given AVA file
### ava2json~parseFileSync(file, [options])
| Param | Type | Description |
| --- | --- | --- |
| file | String | Path to the AVA file |
| [options] | Object | Same options as in [parseAva](parseAva) |
Parses given AVA file synchronously
A module for converting AVA tests syntax into JSON
* * *
### License
[MIT](https://opensource.org/licenses/MIT)
© 2020-present Martin Rafael Gonzalez