An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# ava2json
[![tests](https://github.com/devtin/ava-to-json/workflows/test/badge.svg)](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