TS auto mock
HomeInstallationCreate mockCreate mock listCreate hydrated mockRegister mockExtensionTypes supportedTypes not supportedConfigPerformanceDefinitely TypedLocal developmentPrerequisitesInstall local dependenciesBuild the transformerMake a changeTest your changes

Local development

If you want to add new functionality or fix a bug in ts-auto-mock you are in the right place.

Prerequisites

  • Node.js >= 10
  • NPM
  • A local clone of the repo

Install local dependencies

Make sure you are in the project root folder

npm install

Build the transformer

npm run build

Make a change

ts-auto-mock consists of multiple modules, each of them has a different meaning and depending on what you are editing you can re-build each module individually

  • transformer
  • repository
  • extension
  • merge

If you are editing the transformer:

npm run build:transformer

If you are editing anything else:

npm run build:modules

Test your changes

There are 2 ways to test the effect of your changes

  • Use the existing test system

    • Add a test

    • Run all the tests

      npm run test
      // or use npm run test:transformer if you are just editing the transformer
  • Use the playground

    • Open the file playground.test.ts

    • Make your changes

    • Run test playground to see the test pass

      npm run test:playground
    • Run build playground to see the emitted JS code in the corresponding playground.test.js-file

      npm run build:playground

That's it.