Skip to content

Commit

Permalink
chore: class private method support to jest
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Feb 23, 2024
1 parent 7d4eff9 commit 864a1e7
Show file tree
Hide file tree
Showing 18 changed files with 139 additions and 18 deletions.
8 changes: 7 additions & 1 deletion apps/explorer/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ export default {
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/explorer',
Expand Down
8 changes: 7 additions & 1 deletion apps/hostd/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ export default {
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/hostd',
Expand Down
8 changes: 7 additions & 1 deletion apps/renterd/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ export default {
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/renterd',
Expand Down
8 changes: 7 additions & 1 deletion apps/walletd/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ export default {
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/walletd',
Expand Down
8 changes: 7 additions & 1 deletion apps/website/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ export default {
displayName: 'website',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/website',
Expand Down
9 changes: 8 additions & 1 deletion libs/design-system/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
export default {
displayName: 'design-system',
transform: {
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/design-system',
Expand Down
9 changes: 8 additions & 1 deletion libs/fonts/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
export default {
displayName: 'fonts',
transform: {
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/fonts',
Expand Down
9 changes: 8 additions & 1 deletion libs/next/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ export default {
displayName: 'next',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/next',
Expand Down
9 changes: 8 additions & 1 deletion libs/react-core/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ export default {
displayName: 'react-core',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/react-core',
Expand Down
9 changes: 8 additions & 1 deletion libs/react-hostd/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ export default {
displayName: 'react-hostd',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/react-hostd',
Expand Down
9 changes: 8 additions & 1 deletion libs/react-icons/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
export default {
displayName: 'react-icons',
transform: {
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/react-icons',
Expand Down
9 changes: 8 additions & 1 deletion libs/react-renterd/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ export default {
displayName: 'react-renterd',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/react-renterd',
Expand Down
9 changes: 8 additions & 1 deletion libs/react-sia-central/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ export default {
displayName: 'react-sia-central',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/react-sia-central',
Expand Down
9 changes: 8 additions & 1 deletion libs/react-walletd/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ export default {
displayName: 'react-walletd',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/react-walletd',
Expand Down
9 changes: 8 additions & 1 deletion libs/sdk/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ export default {
displayName: 'sdk',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/sdk',
Expand Down
9 changes: 8 additions & 1 deletion libs/sia-central/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ export default {
displayName: 'sia-central',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/sia-central',
Expand Down
9 changes: 8 additions & 1 deletion libs/types/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ export default {
displayName: 'types',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/types',
Expand Down
9 changes: 8 additions & 1 deletion libs/units/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ export default {
displayName: 'units',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{
presets: ['@nx/next/babel'],
plugins: ['@babel/plugin-transform-private-methods'],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/units',
Expand Down

0 comments on commit 864a1e7

Please sign in to comment.