Skip to content

Commit

Permalink
docs: add steps to use env.config in Jest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnwesson committed Mar 1, 2024
1 parent 9661ada commit 26de6b7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ if you need to do this and are running into problems.

## Local module configuration for Webpack


The development webpack configuration allows engineers to create a
\"module.config.js\" file containing local module overrides. This means
that if you\'re developing a new feature in a shared library
Expand Down Expand Up @@ -218,6 +217,17 @@ locally. To serve a production build locally:
attempt to run the build on the same port specified in the
`env.config.js` file.

## Requiring Jest to reference env.config.js

Jest doesn't rely on webpack to merge the JS-based config into ConfigDocument, so to implement this in your MFE you would need to add it in your MFE's `setupTest.js`

import envConfig from '../env.config';
import mergeConfig from '@edx/frontend-platform';

...

mergeConfig(envConfig);

## Development

This project leverages the command line interface for webpack, jest,
Expand Down

0 comments on commit 26de6b7

Please sign in to comment.