Skip to content

Commit

Permalink
config update
Browse files Browse the repository at this point in the history
  • Loading branch information
mohandast52 committed Feb 28, 2024
1 parent be54d25 commit eb124b0
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions apps/autonolas-registry/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
// import { resolve } from 'path';
// import { pathsToModuleNameMapper } from 'ts-jest/utils';
const { resolve } = require('path');
const { pathsToModuleNameMapper } = require('ts-jest');
const { compilerOptions } = require('../../tsconfig.base.json');

const esModules = ['wagmi'].join('|');

module.exports = {
displayName: 'autonolas-registry',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
useESM: true,
},
},
testEnvironment: 'jsdom',
moduleDirectories: ['node_modules'],
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths, { prefix: resolve(__dirname, '../..') }),
},
setupFilesAfterEnv: ['./jest.setup.js'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
'^.+\\.[tj]sx?$': ['ts-jest', { presets: ['@nx/next/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
transformIgnorePatterns: [`/node_modules/(?!${esModules})`],

// transformIgnorePatterns: [
// 'node_modules/(?!(wagmi)/)',
// ],
coverageDirectory: '../../coverage/apps/autonolas-registry',
// verbose: true,
// collectCoverageFrom: [
Expand Down

0 comments on commit eb124b0

Please sign in to comment.