How to use the tsdx/dist/createJestConfig.createJestConfig function in tsdx

To help you get started, weโ€™ve selected a few tsdx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github samdenty / gqless / jest.config.base.js View on Github external
module.exports = root => {
  let name

  const packageJsonPath = path.resolve(root, 'package.json')
  if (fs.existsSync(packageJsonPath)) {
    const packageJson = require(packageJsonPath)
    name = packageJson.name
  }

  return {
    ...tsdx.createJestConfig(undefined, root),

    globals: {
      __DEV__: true,
      'ts-jest': {
        diagnostics: false,
      },
    },
    displayName: name,
    name: name,
    snapshotSerializers: ['@internal/fixtures/snapshotSerializer.ts'],
    moduleNameMapper: {
      '@gqless/([^\\/]*)/(?:dist|src)(.*)$': path.resolve(
        __dirname,
        './packages/$1/src$2'
      ),
      '@gqless/([^\\/]*)$': path.resolve(__dirname, './packages/$1/src'),

tsdx

Zero-config TypeScript package development

MIT
Latest version published 4 years ago

Package Health Score

62 / 100
Full package analysis