1.1.4 • Published 4 months ago
jestpagenerator v1.1.4
DEPRECATED, PLEASE INSTALL THE FOLLOWING
JestPaGenerator
Hello, 👋
JestPaGenerator is a command-line tool that generates Jest page object files based on data from a JSON Postman collection file.
This tool creates separate .js or .ts files for each folder in your collection, with each folder becoming a single .js or .ts script, and each endpoint within the folders becomes an export function that can be used in your test files.
Support Javascript & TypeScript
- Javascript
- TypeScript
Installation
To use JestPaGenerator, you can install it globally using npm:
npm install -g jestpagenerator
Usage
To generate Jest page files, run the following command:
jestconvert path/to/file.json
that will generate .js or .ts files based on your prefered language, inside pages folder
Notes
- This is just a basic converter, and you may need to adjust the code if your endpoints are complex, but at least now we don't have to create the script from scratch ;)
- Remember to create a folder called files in your project's root directory and put all the files inside it if your endpoints contain files, because all files will be hardcode to ./files/yourfilename.extension
- If you need sample JEST boilerplate go here for Javascript, or here for TypeScript
License
This project is licensed under the MIT License - see the LICENSE file for details.