Skip to content

targendaz2/jest-extended-code

Repository files navigation

jest-extended-code

GitHub License GitHub Release NPM Version GitHub Actions Workflow Status

This package adds code and script matchers to Jest.

Installation

This package is available on npm as jest-extended-code.

npm install -D jest jest-extended-code

Set Up

Individual Matchers

In your Jest configuration file (e.g. jest.config.ts), add the matcher to the setupFilesAfterEnv setting.

const config = {
    setupFilesAfterEnv = ['jest-extended-code/matchers/toOutput.js']
};

All Matchers

Follow the "Individual Matchers" instructions above using jest-extended-code instead of any specific matcher.

const config = {
    setupFilesAfterEnv = ['jest-extended-code']
};

Matchers

  • .toEqualCode()
  • .toOutput()

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

This package is licensed under the MIT License.