Skip to content

Commit 3cf59c7

Browse files
authored
Merge pull request #1 from egm0121/feature/react-components
react functional and class based components parsing + props extraction
2 parents e9e60c0 + 12de7f4 commit 3cf59c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+960
-122
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v0.0.7
4+
5+
- Adds support for parsing React class + functional components to generate snapshot test
6+
37
## v0.0.6
48

59
- more output format tweaks

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,29 @@
33

44
Automates creation of initial unit test files taking dependencies into account.
55

6-
Supported exported types:
6+
Supported exports:
77

8+
* React Functional components 🆕
9+
* React Class based components 🆕
810
* ES6 Classes default export or named exports
911
* Exported named functions and arrow functions
1012
* Exported POJOs with methods
11-
* Async function and methods will generate async test blocks
13+
* Async functions and methods
1214

1315
This tool will take a js/ts file as input and generate a jest unit test file next to it with all imports mocked and tests stubs for every class method and function exported.
1416

1517
This project is inspired and started as a fork of [jasmine-unit-test-generator](https://github.com/FDIM/jasmine-unit-test-generator)
1618

1719
## Preview
1820

19-
Basic input/output example:
21+
Basic ES6 Class example:
2022

2123
![Basic](./assets/demo.jpg)
2224

25+
React Component example:
26+
27+
![ReactComponent](./assets/component.jpg)
28+
2329
## Usage
2430

2531
### Installation

assets/component.jpg

428 KB
Loading

0 commit comments

Comments
 (0)