jest.config.js 741 Bytes
Newer Older
dengxiaofeng's avatar
dengxiaofeng committed
1 2 3 4 5 6 7 8
const { readdirSync } = require('fs');
const { join } = require('path');

const pkgList = readdirSync(join(__dirname, './packages')).filter((pkg) => pkg.charAt(0) !== '.');

const moduleNameMapper = {};

pkgList.forEach((shortName) => {
dengxiaofeng's avatar
dengxiaofeng committed
9
  const name = `@wisdom-components/pro-${shortName}`;
dengxiaofeng's avatar
dengxiaofeng committed
10 11 12 13
  moduleNameMapper[name] = join(__dirname, `./packages/${shortName}/src`);
});

module.exports = {
邓晓峰's avatar
邓晓峰 committed
14
  collectCoverageFrom: ['packages/**/src/**/*.{js}', '!packages/**/src/demos/**'],
dengxiaofeng's avatar
dengxiaofeng committed
15 16 17 18 19 20 21 22
  moduleNameMapper,
  testURL: 'http://localhost',
  verbose: true,
  snapshotSerializers: [require.resolve('enzyme-to-json/serializer')],
  extraSetupFiles: ['./tests/setupTests.js'],
  globals: {
    ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: false,
  },
邓晓峰's avatar
邓晓峰 committed
23
};