Skip to content

Commit

Permalink
Merge pull request #303 from folio-org/STCLI-220
Browse files Browse the repository at this point in the history
STCLI-220: Adjust webpack config for karma to avoid warnings
  • Loading branch information
mkuklis authored Dec 6, 2022
2 parents 0faaa6a + 65564e6 commit fbb6a89
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Fix outputPath positional is ignored on `build` command. Refs STCLI-165.
* Add `stripes-ui` to the list of stripes modules. Refs STCLI-217.
* Turn off `exprContextCritical` when running karma tests. Refs STCLI-220.

## [2.6.1](https://github.com/folio-org/stripes-cli/tree/v2.6.1) (2022-10-11)

Expand Down
12 changes: 12 additions & 0 deletions lib/commands/test/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ function karmaCommand(argv) {
};
const webpackConfig = stripes.getStripesWebpackConfig(platform.getStripesConfig(), webpackConfigOptions, context);

// This fixes the warnings similar to:
// WARNING in ./node_modules/mocha/mocha-es2018.js 18541:26-55
// Critical dependency: the request of a dependency is an expression
// https://github.com/mochajs/mocha/issues/2448#issuecomment-355222358
webpackConfig.module.exprContextCritical = false;

// This fixes warning:
// WARNING in DefinePlugin
// Conflicting values for 'process.env.NODE_ENV'
// https://webpack.js.org/configuration/mode/#usage
webpackConfig.mode = 'none';

const karmaService = new KarmaService(context.cwd);
karmaService.runKarmaTests(webpackConfig, Object.assign({}, argv.karma, { watch: argv.watch, cache: argv.cache }));
}
Expand Down

0 comments on commit fbb6a89

Please sign in to comment.