@moxy/jest-config-testing-library

MOXY's Jest configuration enhancer for RTL and NTL

Usage no npm install needed!

<script type="module">
  import moxyJestConfigTestingLibrary from 'https://cdn.skypack.dev/@moxy/jest-config-testing-library';
</script>

README

jest-config-testing-library

NPM version Downloads Dependency status Dev Dependency status

MOXY's Jest configuration enhancer for:

Installation

$ npm install --save-dev jest @moxy/jest-config-base @moxy/jest-config-testing-library

This package should be used in conjunction with @moxy/jest-config-base. There are two enhancers available:

withRTL

An enhancer for web projects tested with React Testing Library.

What's included?

  • Extended matchers: Make assertions easier and clearer by using jest-dom.

Usage

To use this enhancer, use the compose function that comes with this package. Keep in mind, the first item should always be the base configuration!

'use strict';

const { compose, baseConfig } = require('@moxy/jest-config-base');
const { withRTL } = require('@moxy/jest-config-testing-library');

module.exports = compose(
    baseConfig(),
    withRTL(),
);

⚠️ Make sure withRTL is composed only after withWeb from @moxy/jest-config-web.

withNTL

An enhancer for React Native apps tested with Native Testing Library.

What's included?

  • Extended matchers: Make assertions easier and clearer by using jest-native.

Usage

To use this enhancer, use the compose function that comes with this package. Keep in mind, the first item should always be the base configuration!

'use strict';

const { compose, baseConfig } = require('@moxy/jest-config-base');
const { withNTL } = require('@moxy/jest-config-testing-library');

module.exports = compose(
    baseConfig('node'),
    withNTL(),
);

⚠️ Make sure withNTL is composed only after withReactNative from @moxy/jest-config-react-native.