@talend/scripts-config-jest

14.0.4 • Public • Published

Jest config customisation

To use the jest configuration in your IDE, or to add customisation

  1. Create an jest.config.js at your project root folder
  2. Make it extend the one from talend preset
const defaults = require('@talend/scripts-config-jest');

module.exports = {
	...defaults,

	// add/change default config here
};

how stop ignore transform over packages in node_modules

because jest support of ECMAPScriptModules is experiemental we have added possibilities to apply transforms on modules. Since d3 7.x library use ECMAPScriptModules in it's package.json as main entry point it break jest with this kind of errors:

node_modules/d3-scale/src/index.js:1
export {
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'

You may encounter in your project the need to add other modules than just d3. To do so we provide to you the following API:

// your project's jest.config.js
const config = require('@talend/scripts-config-jest/jest.config.js');
const testUtils = require('@talend/scripts-config-jest/utils');

testUtils.applyBabelTransformOn(config, ['dexie']);

module.exports = config;

Readme

Keywords

none

Package Sidebar

Install

npm i @talend/scripts-config-jest

Weekly Downloads

681

Version

14.0.4

License

Apache-2.0

Unpacked Size

18.4 kB

Total Files

12

Last publish

Collaborators

  • talend-frontend