-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a57dc11
commit 339483c
Showing
12 changed files
with
199 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
displayName: { | ||
name: 'Powertools for AWS Lambda (TypeScript) utility: BATCH', | ||
color: 'orange', | ||
}, | ||
runner: 'groups', | ||
preset: 'ts-jest', | ||
transform: { | ||
'^.+\\.ts?$': 'ts-jest', | ||
}, | ||
moduleFileExtensions: ['js', 'ts'], | ||
collectCoverageFrom: ['**/src/**/*.ts', '!**/node_modules/**'], | ||
testMatch: ['**/?(*.)+(spec|test).ts'], | ||
roots: ['<rootDir>/src', '<rootDir>/tests'], | ||
testPathIgnorePatterns: ['/node_modules/'], | ||
testEnvironment: 'node', | ||
coveragePathIgnorePatterns: ['/node_modules/', '/types/'], | ||
coverageThreshold: { | ||
global: { | ||
statements: 100, | ||
branches: 100, | ||
functions: 100, | ||
lines: 100, | ||
}, | ||
}, | ||
coverageReporters: ['json-summary', 'text', 'lcov'], | ||
setupFiles: ['<rootDir>/tests/helpers/populateEnvironmentVariables.ts'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"name": "@aws-lambda-powertools/batch", | ||
"version": "1.10.0", | ||
"description": "The batch processing package for the Powertools for AWS Lambda (TypeScript) library.", | ||
"author": { | ||
"name": "Amazon Web Services", | ||
"url": "https://aws.amazon.com" | ||
}, | ||
"private": true, | ||
"scripts": { | ||
"test": "npm run test:unit", | ||
"test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose", | ||
"test:e2e:nodejs14x": "echo 'Not Implemented'", | ||
"test:e2e:nodejs16x": "echo 'Not Implemented'", | ||
"test:e2e:nodejs18x": "echo 'Not Implemented'", | ||
"test:e2e": "echo 'Not Implemented'", | ||
"watch": "jest --watch", | ||
"build": "tsc", | ||
"lint": "eslint --ext .ts,.js --no-error-on-unmatched-pattern .", | ||
"lint-fix": "eslint --fix --ext .ts,.js --no-error-on-unmatched-pattern .", | ||
"prebuild": "rimraf ./lib", | ||
"prepack": "node ../../.github/scripts/release_patch_package_json.js ." | ||
}, | ||
"lint-staged": { | ||
"*.ts": "npm run lint-fix", | ||
"*.js": "npm run lint-fix" | ||
}, | ||
"homepage": "https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/packages/batch#readme", | ||
"license": "MIT-0", | ||
"main": "./lib/index.js", | ||
"types": "./lib/index.d.ts", | ||
"files": [ | ||
"lib" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/aws-powertools/powertools-lambda-typescript.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/aws-powertools/powertools-lambda-typescript/issues" | ||
}, | ||
"dependencies": {}, | ||
"keywords": [ | ||
"aws", | ||
"lambda", | ||
"powertools", | ||
"batch", | ||
"batch-processing", | ||
"serverless", | ||
"nodejs" | ||
], | ||
"devDependencies": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class BatchProcessor {} | ||
|
||
export { BatchProcessor }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './BatchProcessor'; |
12 changes: 12 additions & 0 deletions
12
packages/batch/tests/helpers/populateEnvironmentVariables.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Reserved variables | ||
process.env._X_AMZN_TRACE_ID = '1-abcdef12-3456abcdef123456abcdef12'; | ||
process.env.AWS_LAMBDA_FUNCTION_NAME = 'my-lambda-function'; | ||
process.env.AWS_EXECUTION_ENV = 'nodejs18.x'; | ||
process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE = '128'; | ||
if ( | ||
process.env.AWS_REGION === undefined && | ||
process.env.CDK_DEFAULT_REGION === undefined | ||
) { | ||
process.env.AWS_REGION = 'eu-west-1'; | ||
} | ||
process.env._HANDLER = 'index.handler'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Test BatchProcessor class | ||
* | ||
* @group unit/batch/class/batchprocessor | ||
*/ | ||
import { BatchProcessor } from '../../src'; | ||
|
||
describe('Class: IdempotencyConfig', () => { | ||
const ENVIRONMENT_VARIABLES = process.env; | ||
|
||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
jest.resetModules(); | ||
process.env = { ...ENVIRONMENT_VARIABLES }; | ||
}); | ||
|
||
afterAll(() => { | ||
process.env = ENVIRONMENT_VARIABLES; | ||
}); | ||
|
||
describe('remove me', () => { | ||
test('does stuff', () => { | ||
expect(BatchProcessor).toBeDefined(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"declarationMap": true, | ||
"esModuleInterop": false | ||
}, | ||
"include": [ "src/**/*", "examples/**/*", "**/tests/**/*" ], | ||
"types": [ | ||
"jest" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"declarationMap": true, | ||
"esModuleInterop": false | ||
}, | ||
"include": [ "src/**/*", "examples/**/*", "**/tests/**/*" ], | ||
"types": [ | ||
"jest" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"compilerOptions": { | ||
"experimentalDecorators": true, | ||
"noImplicitAny": true, | ||
"target": "ES2020", | ||
"module": "commonjs", | ||
"declaration": true, | ||
"outDir": "lib", | ||
"strict": true, | ||
"inlineSourceMap": true, | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"pretty": true, | ||
"baseUrl": "src/", | ||
"rootDirs": [ "src/" ], | ||
"esModuleInterop": true | ||
}, | ||
"include": [ "src/**/*" ], | ||
"exclude": [ "./node_modules"], | ||
"watchOptions": { | ||
"watchFile": "useFsEvents", | ||
"watchDirectory": "useFsEvents", | ||
"fallbackPolling": "dynamicPriority" | ||
}, | ||
"lib": [ "es2020" ], | ||
"types": [ | ||
"node" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"extends": [ | ||
"../../typedoc.base.json" | ||
], | ||
"entryPoints": [ | ||
"./src/index.ts", | ||
"./src/types/index.ts", | ||
"./src/middleware/index.ts", | ||
"./src/persistence/index.ts" | ||
], | ||
"readme": "README.md" | ||
} |