Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

This codemod is to help transition from importing faker through ember-cli-mirage, to instead import it directly from faker.

For more background on the situation, see this github issue.

How To Remove The Faker Dependency

Install faker and ember-auto-import

yarn add faker
git add . && git commit -m "adding faker package"
ember install ember-auto-import
git add . && git commit -m "installing ember-auto-import package"

add to your ember-cli-build.js:

    autoImport: {
      alias: {
        'faker': 'build/build/faker'
git add . && git commit -m "telling ember-cli-build where to find faker"

Run the codemod

This example will run the codemod on all files in the ./tests folder. Then you can selectively check in as many changes as you'd like to keep (try git add -p!).

npm install -g jscodeshift
jscodeshift -t ./tests
  • If you find additional edge cases, please clone this repo and contribute :D
  • Don't be afraid of codemods, check out Casey's tutorial

How do codemods even?

If this is your first codemod (it's mine!), I wrote a lot about how I got up and running with codemods - check it out!


git clone`
cd ember-cli-mirage-faker-codemod`
npm install
npm test
npm run codemod path/to/directories/or/files/you/want

Make sure to add test cases to the __testfixtures__ (see the tutorial for details).

You can’t perform that action at this time.