Faker Staticify

A nodejs cli to replace faker with static mocks.

project logo image
TypeScript Faker NodeJs

Why?

📍 Why?

I created this little CLI tool as a project I was working on had a lot of faker data within our unit test files. This allowed me to quickly replace all usage with static data. This sped up the tests a lot and reduced the amount of flakey tests in the project.

Installation

📍 Installation
npm install faker-staticify -g

Usage

📍 Usage

Simply run

faker-staticify

Within the project root directory, it will search out all *.spec.ts files and staticify your faker.

Please note: This package will not remove the left over imports, I recommend using something like eslint to remove the unused imports after this runs.

More Projects