jest.config.js 845 B

1234567891011121314151617181920212223242526
  1. // Copyright 2017-2020 @polkadot/apps authors & contributors
  2. // This software may be modified and distributed under the terms
  3. // of the Apache-2.0 license. See the LICENSE file for details.
  4. const config = require('@polkadot/dev/config/jest');
  5. const findPackages = require('./scripts/findPackages');
  6. const internalModules = findPackages()
  7. .filter(({ name }) => !['@polkadot/apps'].includes(name))
  8. .reduce((modules, { dir, name }) => {
  9. modules[`${name}(.*)$`] = `<rootDir>/packages/${dir}/src/$1`;
  10. return modules;
  11. }, {});
  12. module.exports = Object.assign({}, config, {
  13. moduleNameMapper: {
  14. ...internalModules,
  15. '\\.(css|less)$': 'empty/object',
  16. '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': 'empty/object'
  17. },
  18. transformIgnorePatterns: [
  19. '<rootDir>/node_modules'
  20. ]
  21. });