Skip to content

Commit

Permalink
fix(esm): updating jest to support esm
Browse files Browse the repository at this point in the history
  • Loading branch information
bassrock committed Jan 3, 2025
1 parent d780b10 commit 4c2fccc
Show file tree
Hide file tree
Showing 43 changed files with 183 additions and 85 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
module.exports = {
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|integration).ts'],
testPathIgnorePatterns: ['/dist/'],
setupFiles: ['./jest.setup.js'],
setupFiles: ['./jest.setup.ts'],
displayName: 'lambda-batchdelete',
testTimeout: 1000000,
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1"
},
};

export default config;
2 changes: 1 addition & 1 deletion lambdas/account-data-deleter-batch-delete/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"outDir": "dist",
"rootDir": "src"
},
"exclude": ["node_modules", "jest.config.js", "jest.setup.js"],
"exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"],
"include": [
"src/**/*.ts",
]
Expand Down
8 changes: 0 additions & 8 deletions lambdas/account-data-deleter-events/jest.config.js

This file was deleted.

15 changes: 15 additions & 0 deletions lambdas/account-data-deleter-events/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|integration).ts'],
testPathIgnorePatterns: ['/dist/'],
setupFiles: ['./jest.setup.ts'],
displayName: 'lambda-events',
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1"
},
};

export default config;
2 changes: 1 addition & 1 deletion lambdas/account-data-deleter-events/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"outDir": "dist",
"rootDir": "src"
},
"exclude": ["node_modules", "jest.config.js", "jest.setup.js"],
"exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"],
"include": [
"src/**/*.ts",
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
module.exports = {
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|integration).ts'],
testPathIgnorePatterns: ['/dist/'],
displayName: 'account-delete-monitor',
setupFiles: ['./jest.setup.js'],
setupFiles: ['./jest.setup.ts'],
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1"
},
};

export default config;
2 changes: 1 addition & 1 deletion lambdas/account-delete-monitor/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"outDir": "dist",
"rootDir": "src"
},
"exclude": ["node_modules", "jest.config.js", "jest.setup.js"],
"exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"],
"include": [
"src/**/*.ts",
]
Expand Down
8 changes: 0 additions & 8 deletions lambdas/annotations-api-events/jest.config.js

This file was deleted.

15 changes: 15 additions & 0 deletions lambdas/annotations-api-events/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|integration).ts'],
testPathIgnorePatterns: ['/dist/'],
setupFiles: ['./jest.setup.ts'],
displayName: 'lambda-events',
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1"
},
};

export default config;
2 changes: 1 addition & 1 deletion lambdas/annotations-api-events/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"outDir": "dist",
"rootDir": "src"
},
"exclude": ["node_modules", "jest.config.js", "jest.setup.js"],
"exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"],
"include": [
"src/**/*.ts",
]
Expand Down
7 changes: 0 additions & 7 deletions lambdas/fxa-webook-proxy-gateway/jest.config.js

This file was deleted.

14 changes: 14 additions & 0 deletions lambdas/fxa-webook-proxy-gateway/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|functional).ts'],
testPathIgnorePatterns: ['/dist/'],
setupFiles: ['./jest.setup.ts'],
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1"
},
};

export default config;
7 changes: 0 additions & 7 deletions lambdas/fxa-webook-proxy-sqs/jest.config.js

This file was deleted.

14 changes: 14 additions & 0 deletions lambdas/fxa-webook-proxy-sqs/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|functional).ts'],
testPathIgnorePatterns: ['/dist/'],
setupFiles: ['./jest.setup.ts'],
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1"
},
};

export default config;
File renamed without changes.
8 changes: 0 additions & 8 deletions lambdas/instant-sync-events/jest.config.js

This file was deleted.

15 changes: 15 additions & 0 deletions lambdas/instant-sync-events/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|integration).ts'],
testPathIgnorePatterns: ['/dist/'],
displayName: 'instant-sync-events',
setupFiles: ['./jest.setup.ts'],
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1"
},
};

export default config;
File renamed without changes.
2 changes: 1 addition & 1 deletion lambdas/instant-sync-events/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"rootDir": "src",
"outDir": "dist",
},
"exclude": ["node_modules", "jest.config.js", "jest.setup.js"],
"exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"],
"include": ["./**/*.ts"]
}
7 changes: 0 additions & 7 deletions lambdas/sendgrid-data/jest.config.js

This file was deleted.

14 changes: 14 additions & 0 deletions lambdas/sendgrid-data/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|functional).ts'],
testPathIgnorePatterns: ['/dist/'],
setupFiles: ['./jest.setup.ts'],
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1"
},
};

export default config;
File renamed without changes.
8 changes: 0 additions & 8 deletions lambdas/shareable-lists-api-events/jest.config.js

This file was deleted.

15 changes: 15 additions & 0 deletions lambdas/shareable-lists-api-events/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|integration).ts'],
testPathIgnorePatterns: ['/dist/'],
setupFiles: ['./jest.setup.ts'],
displayName: 'lambda-events',
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1"
},
};

export default config;
2 changes: 1 addition & 1 deletion lambdas/shareable-lists-api-events/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"outDir": "dist",
"rootDir": "src"
},
"exclude": ["node_modules", "jest.config.js", "jest.setup.js"],
"exclude": ["node_modules", "jest.config.ys", "jest.setup.ts"],
"include": ["src/**/*.ts"]
}
6 changes: 0 additions & 6 deletions lambdas/transactional-emails/jest.config.js

This file was deleted.

13 changes: 13 additions & 0 deletions lambdas/transactional-emails/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|integration).ts'],
testPathIgnorePatterns: ['/dist/'],
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1"
},
};

export default config;
8 changes: 0 additions & 8 deletions lambdas/user-list-search-corpus-indexing/jest.config.js

This file was deleted.

15 changes: 15 additions & 0 deletions lambdas/user-list-search-corpus-indexing/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|integration).ts'],
testPathIgnorePatterns: ['/dist/'],
setupFiles: ['./jest.setup.ts'],
displayName: 'corpus-index-lambda',
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1"
},
};

export default config;
2 changes: 1 addition & 1 deletion lambdas/user-list-search-corpus-indexing/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"outDir": "dist",
"rootDir": "src"
},
"exclude": ["node_modules", "jest.config.js", "jest.setup.js"],
"exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"],
"include": ["src/**/*.ts"]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
module.exports = {
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|integration).ts'],
testPathIgnorePatterns: ['/dist/'],
displayName: 'events-lambda',
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1"
},
};

export default config;
2 changes: 1 addition & 1 deletion lambdas/user-list-search-events/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"compilerOptions": {
"outDir": "dist",
},
"exclude": ["node_modules", "jest.config.js", "jest.setup.js"],
"exclude": ["node_modules", "jest.config.cjs", "jest.setup.js"],
"include": ["./**/*.ts"]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
module.exports = {
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|integration).ts'],
testPathIgnorePatterns: ['/dist/'],
displayName: 'user-list-search-kinesis-to-sqs-lambda',
setupFilesAfterEnv: ['jest-extended/all'],
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1"
},
};

export default config;
4 changes: 2 additions & 2 deletions lambdas/user-list-search-indexing/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"outDir": "dist",
},
"exclude": ["node_modules", "jest.config.js", "jest.setup.js"],
"include": ["./**/*.ts"],
"exclude": ["node_modules", "jest.config.ts", "jest.setup.js"],
"include": ["./**/*.ts", "jest.config.ts"],
"files": ["node_modules/jest-extended/types/index.d.ts"]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
module.exports = {
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|integration).ts'],
testPathIgnorePatterns: ['/dist/'],
displayName: 'user-list-search-kinesis-to-sqs-lambda',
setupFilesAfterEnv: ['jest-extended/all'],
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1"
},
};

export default config;
Loading

0 comments on commit 4c2fccc

Please sign in to comment.