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 6, 2025
1 parent 3648ee7 commit a1c4f9e
Show file tree
Hide file tree
Showing 61 changed files with 239 additions and 122 deletions.
9 changes: 0 additions & 9 deletions lambdas/account-data-deleter-batch-delete/jest.config.js

This file was deleted.

17 changes: 17 additions & 0 deletions lambdas/account-data-deleter-batch-delete/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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-batchdelete',
testTimeout: 1000000,
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1",
"^(\\..\\/.+)\\.js$": "$1"
},
};

export default config;
2 changes: 1 addition & 1 deletion lambdas/account-data-deleter-batch-delete/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "",
"license": "ISC",
"author": "",
"main": "dist/index.js",
"type": "module",
"main": "dist/index.js",
"files": [
"dist",
"package.json"
Expand Down
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.

16 changes: 16 additions & 0 deletions lambdas/account-data-deleter-events/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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",
"^(\\..\\/.+)\\.js$": "$1"
},
};

export default config;
2 changes: 1 addition & 1 deletion lambdas/account-data-deleter-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"description": "",
"license": "ISC",
"author": "",
"type": "module",
"main": "dist/index.js",
"files": [
"dist",
"package.json"
],
"type": "module",
"scripts": {
"build": "rm -rf dist && tsc",
"format": "eslint --fix",
Expand Down
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
8 changes: 0 additions & 8 deletions lambdas/account-delete-monitor/jest.config.js

This file was deleted.

16 changes: 16 additions & 0 deletions lambdas/account-delete-monitor/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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.ts'],
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1",
"^(\\..\\/.+)\\.js$": "$1"
},
};

export default config;
2 changes: 1 addition & 1 deletion lambdas/account-delete-monitor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"description": "",
"license": "ISC",
"author": "",
"type": "module",
"main": "dist/index.js",
"files": [
"dist",
"package.json"
],
"type": "module",
"scripts": {
"build": "rm -rf dist && tsc",
"format": "eslint --fix",
Expand Down
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.

16 changes: 16 additions & 0 deletions lambdas/annotations-api-events/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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",
"^(\\..\\/.+)\\.js$": "$1"
},
};

export default config;
2 changes: 1 addition & 1 deletion lambdas/annotations-api-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "",
"license": "ISC",
"author": "",
"main": "dist/index.js",
"type": "module",
"main": "dist/index.js",
"files": [
"dist",
"package.json"
Expand Down
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.

15 changes: 15 additions & 0 deletions lambdas/fxa-webook-proxy-gateway/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|functional).ts'],
testPathIgnorePatterns: ['/dist/'],
setupFiles: ['./jest.setup.ts'],
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1",
"^(\\..\\/.+)\\.js$": "$1"
},
};

export default config;
2 changes: 1 addition & 1 deletion lambdas/fxa-webook-proxy-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"keywords": [],
"license": "ISC",
"author": "",
"main": "dist/index.js",
"type": "module",
"main": "dist/index.js",
"files": [
"dist",
"package.json"
Expand Down
7 changes: 0 additions & 7 deletions lambdas/fxa-webook-proxy-sqs/jest.config.js

This file was deleted.

15 changes: 15 additions & 0 deletions lambdas/fxa-webook-proxy-sqs/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|functional).ts'],
testPathIgnorePatterns: ['/dist/'],
setupFiles: ['./jest.setup.ts'],
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1",
"^(\\..\\/.+)\\.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.

16 changes: 16 additions & 0 deletions lambdas/instant-sync-events/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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",
"^(\\..\\/.+)\\.js$": "$1"
},
};

export default config;
File renamed without changes.
2 changes: 1 addition & 1 deletion lambdas/instant-sync-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "instant-sync-events",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "dist/index.js",
"files": [
"dist",
"package.json"
],
"type": "module",
"scripts": {
"build": "rm -rf dist && tsc",
"format": "eslint --fix",
Expand Down
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.

15 changes: 15 additions & 0 deletions lambdas/sendgrid-data/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|functional).ts'],
testPathIgnorePatterns: ['/dist/'],
setupFiles: ['./jest.setup.ts'],
moduleNameMapper: {
"^(\\.\\/.+)\\.js$": "$1",
"^(\\..\\/.+)\\.js$": "$1"
},
};

export default config;
File renamed without changes.
2 changes: 1 addition & 1 deletion lambdas/sendgrid-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "sendgrid-data",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "index.js",
"files": [
"dist",
"package.json"
],
"type": "module",
"scripts": {
"build": "rm -rf dist && tsc",
"format": "eslint --fix",
Expand Down
6 changes: 5 additions & 1 deletion lambdas/sendgrid-data/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ Sentry.init({
release: config.sentry.release,
environment: config.environment,
});
import { deliverEvents, logEventsError, logEventsReceived } from './sendgrid/index.ts';
import {
deliverEvents,
logEventsError,
logEventsReceived,
} from './sendgrid/index.ts';
import { captureException } from './sentry.ts';
import type { APIGatewayEvent, APIGatewayProxyResult } from 'aws-lambda';

Expand Down
8 changes: 0 additions & 8 deletions lambdas/shareable-lists-api-events/jest.config.js

This file was deleted.

16 changes: 16 additions & 0 deletions lambdas/shareable-lists-api-events/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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",
"^(\\..\\/.+)\\.js$": "$1"
},
};

export default config;
2 changes: 1 addition & 1 deletion lambdas/shareable-lists-api-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"description": "",
"license": "ISC",
"author": "",
"type": "module",
"main": "dist/index.js",
"files": [
"dist",
"package.json"
],
"type": "module",
"scripts": {
"build": "rm -rf dist && tsc",
"format": "eslint --fix",
Expand Down
Loading

0 comments on commit a1c4f9e

Please sign in to comment.