-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve support for payload objects and ESM JS files
- Loading branch information
Showing
14 changed files
with
3,666 additions
and
1,285 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.nyc_output/ | ||
node_modules/ | ||
|
||
reports/ | ||
test-reports/ | ||
/.semverDetails |
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,4 @@ | ||
#!/usr/bin/env node | ||
import { main } from '../src/ptx.js'; | ||
|
||
await main(); |
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,21 @@ | ||
{ | ||
"lambdaARN": "arn:aws:lambda:ap-southeast-2:0000000000:function:your-lambda", | ||
"powerValues": [384, 512, 768, 1024, 1280], | ||
"num": 20, | ||
"payload": [ | ||
{ | ||
"payload": { | ||
"$$include1": "../payloads/p1.json" | ||
}, | ||
"weight": 10 | ||
}, | ||
{ | ||
"payload": { | ||
"$$include1": "../payloads/p2.json" | ||
}, | ||
"weight": 10 | ||
} | ||
], | ||
"parallelInvocation": true, | ||
"strategy": "balanced" | ||
} |
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,16 @@ | ||
{ | ||
"lambdaARN": "arn:aws:lambda:ap-southeast-2:0000000000:function:your-lambda", | ||
"powerValues": [384, 512, 768, 1024, 1280], | ||
"num": 20, | ||
"payload": [ | ||
{ | ||
"payload": { | ||
"$$include1": "./testFunction.cjs", | ||
"$$args1": ["Hello", "World CJS"] | ||
}, | ||
"weight": 20 | ||
} | ||
], | ||
"parallelInvocation": true, | ||
"strategy": "balanced" | ||
} |
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 @@ | ||
{ | ||
"lambdaARN": "arn:aws:lambda:ap-southeast-2:0000000000:function:your-lambda", | ||
"powerValues": [384, 512, 768, 1024, 1280], | ||
"num": 20, | ||
"payload": { | ||
"$$include1": "./testFunction.js", | ||
"$$args1": ["Hello", "World ESM"] | ||
}, | ||
"parallelInvocation": true, | ||
"strategy": "balanced" | ||
} |
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,10 @@ | ||
{ | ||
"lambdaARN": "arn:aws:lambda:ap-southeast-2:0000000000:function:your-lambda", | ||
"powerValues": [384, 512, 768, 1024, 1280], | ||
"num": 20, | ||
"payload": { | ||
"$$include1": "../payloads/p1.json" | ||
}, | ||
"parallelInvocation": true, | ||
"strategy": "balanced" | ||
} |
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,6 @@ | ||
module.exports = function payloadAdaptor(arg1, arg2) { | ||
return { | ||
isBase64Encoded: false, | ||
body: `${arg1} ${arg2}!`, | ||
}; | ||
}; |
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,6 @@ | ||
export default function payloadAdaptor(arg1, arg2) { | ||
return { | ||
isBase64Encoded: false, | ||
body: `${arg1} ${arg2}!`, | ||
}; | ||
} |
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,43 @@ | ||
/* | ||
* For a detailed explanation regarding each configuration property, visit: | ||
* https://jestjs.io/docs/configuration | ||
*/ | ||
|
||
export default { | ||
// The test environment that will be used for testing | ||
testEnvironment: 'node', | ||
|
||
// See https://jestjs.io/docs/ecmascript-modules | ||
transform: {}, | ||
|
||
// All imported modules in your tests should be mocked automatically | ||
automock: false, | ||
|
||
// Automatically clear mock calls and instances between every test | ||
clearMocks: true, | ||
|
||
reporters: ['default'], | ||
|
||
collectCoverageFrom: ['src/**/*.js', '!src/logger.js'], | ||
coverageReporters: ['json-summary', 'lcov', 'text', 'html'], | ||
coverageDirectory: '<rootDir>/test-reports/coverage', | ||
coverageThreshold: { | ||
global: { | ||
statements: 30, | ||
branches: 80, | ||
functions: 12, | ||
lines: 30, | ||
}, | ||
}, | ||
|
||
// Indicates which provider should be used to instrument code for coverage | ||
coverageProvider: 'v8', | ||
|
||
moduleDirectories: ['node_modules'], | ||
|
||
// https://github.com/chalk/chalk/issues/532 | ||
|
||
moduleNameMapper: { | ||
'#(.*)': '<rootDir>/node_modules/$1', | ||
}, | ||
}; |
Oops, something went wrong.