aws-testing-library
Advanced tools
Comparing version 1.1.6 to 2.0.0
@@ -9,3 +9,3 @@ "use strict"; | ||
const props = this._obj; | ||
(0, common_1.verifyProps)(Object.assign(Object.assign({}, props), { pattern }), cloudwatch_1.expectedProps); | ||
(0, common_1.verifyProps)({ ...props, pattern }, cloudwatch_1.expectedProps); | ||
const { region, function: functionName, startTime = (0, common_1.epochDateMinusHours)(1), } = props; | ||
@@ -12,0 +12,0 @@ const { events } = await (0, cloudwatch_2.filterLogEvents)(region, functionName, startTime, pattern); |
@@ -9,3 +9,3 @@ "use strict"; | ||
const props = this._obj; | ||
(0, common_1.verifyProps)(Object.assign(Object.assign({}, props), { key }), dynamoDb_1.expectedProps); | ||
(0, common_1.verifyProps)({ ...props, key }, dynamoDb_1.expectedProps); | ||
const { region, table } = props; | ||
@@ -12,0 +12,0 @@ let received = await (0, dynamoDb_2.getItem)(region, table, key); |
@@ -9,3 +9,3 @@ "use strict"; | ||
const props = this._obj; | ||
(0, common_1.verifyProps)(Object.assign(Object.assign({}, props), { matcher }), kinesis_1.expectedProps); | ||
(0, common_1.verifyProps)({ ...props, matcher }, kinesis_1.expectedProps); | ||
const { region, stream, timeout = 10 * 1000, pollEvery = 500 } = props; | ||
@@ -12,0 +12,0 @@ const found = await (0, kinesis_2.existsInStream)(region, stream, matcher, timeout, pollEvery); |
@@ -9,3 +9,3 @@ "use strict"; | ||
const props = this._obj; | ||
(0, common_1.verifyProps)(Object.assign(Object.assign({}, props), { key }), s3_1.expectedProps); | ||
(0, common_1.verifyProps)({ ...props, key }, s3_1.expectedProps); | ||
const { region, bucket } = props; | ||
@@ -12,0 +12,0 @@ const { body: received, found } = await (0, s3_2.getObject)(region, bucket, key); |
@@ -9,3 +9,3 @@ "use strict"; | ||
const props = this._obj; | ||
(0, common_1.verifyProps)(Object.assign(Object.assign({}, props), { matcher }), sqs_1.expectedProps); | ||
(0, common_1.verifyProps)({ ...props, matcher }, sqs_1.expectedProps); | ||
const { region, queueUrl } = props; | ||
@@ -12,0 +12,0 @@ const found = await (0, sqs_2.existsInQueue)(region, queueUrl, matcher); |
@@ -9,3 +9,3 @@ "use strict"; | ||
const props = this._obj; | ||
(0, common_1.verifyProps)(Object.assign(Object.assign({}, props), { state }), stepFunctions_1.expectedProps); | ||
(0, common_1.verifyProps)({ ...props, state }, stepFunctions_1.expectedProps); | ||
const { region, stateMachineArn } = props; | ||
@@ -22,3 +22,3 @@ const received = await (0, stepFunctions_2.getCurrentState)(region, stateMachineArn); | ||
const props = this._obj; | ||
(0, common_1.verifyProps)(Object.assign(Object.assign({}, props), { state }), stepFunctions_1.expectedProps); | ||
(0, common_1.verifyProps)({ ...props, state }, stepFunctions_1.expectedProps); | ||
const { region, stateMachineArn } = props; | ||
@@ -25,0 +25,0 @@ const states = await (0, stepFunctions_2.getStates)(region, stateMachineArn); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.removeKeysFromItemForNonStrictComparison = exports.expectedProps = void 0; | ||
const filterObject = require("filter-obj"); | ||
const filter_obj_1 = require("filter-obj"); | ||
exports.expectedProps = ['region', 'table', 'key']; | ||
const removeKeysFromItemForNonStrictComparison = (received, expected) => { | ||
return filterObject(received, (key) => Object.prototype.hasOwnProperty.call(expected, key)); | ||
return (0, filter_obj_1.default)(received, (key) => Object.prototype.hasOwnProperty.call(expected, key)); | ||
}; | ||
exports.removeKeysFromItemForNonStrictComparison = removeKeysFromItemForNonStrictComparison; | ||
//# sourceMappingURL=dynamoDb.js.map |
@@ -10,3 +10,3 @@ "use strict"; | ||
const toReturnResponse = async function (props, expected) { | ||
(0, common_1.verifyProps)(Object.assign({}, props), api_1.expectedProps); | ||
(0, common_1.verifyProps)({ ...props }, api_1.expectedProps); | ||
const { url, method, params, data, headers } = props; | ||
@@ -13,0 +13,0 @@ try { |
@@ -9,3 +9,3 @@ "use strict"; | ||
const toHaveLog = async function (props, pattern) { | ||
(0, index_1.verifyProps)(Object.assign(Object.assign({}, props), { pattern }), cloudwatch_1.expectedProps); | ||
(0, index_1.verifyProps)({ ...props, pattern }, cloudwatch_1.expectedProps); | ||
const { region, function: functionName, startTime = (0, index_1.epochDateMinusHours)(1), } = props; | ||
@@ -12,0 +12,0 @@ try { |
@@ -10,3 +10,3 @@ "use strict"; | ||
const toHaveItem = async function (props, key, expected, strict = true) { | ||
(0, common_1.verifyProps)(Object.assign(Object.assign({}, props), { key }), dynamoDb_1.expectedProps); | ||
(0, common_1.verifyProps)({ ...props, key }, dynamoDb_1.expectedProps); | ||
const { region, table } = props; | ||
@@ -13,0 +13,0 @@ try { |
@@ -9,3 +9,3 @@ "use strict"; | ||
const toHaveRecord = async function (props, matcher) { | ||
(0, common_1.verifyProps)(Object.assign(Object.assign({}, props), { matcher }), kinesis_1.expectedProps); | ||
(0, common_1.verifyProps)({ ...props, matcher }, kinesis_1.expectedProps); | ||
const { region, stream, timeout = 10 * 1000, pollEvery = 500 } = props; | ||
@@ -12,0 +12,0 @@ try { |
@@ -10,3 +10,3 @@ "use strict"; | ||
const toHaveObject = async function (props, key, expected) { | ||
(0, common_1.verifyProps)(Object.assign(Object.assign({}, props), { key }), s3_1.expectedProps); | ||
(0, common_1.verifyProps)({ ...props, key }, s3_1.expectedProps); | ||
const { region, bucket } = props; | ||
@@ -13,0 +13,0 @@ try { |
@@ -9,3 +9,3 @@ "use strict"; | ||
const toHaveMessage = async function (props, matcher) { | ||
(0, common_1.verifyProps)(Object.assign(Object.assign({}, props), { matcher }), sqs_1.expectedProps); | ||
(0, common_1.verifyProps)({ ...props, matcher }, sqs_1.expectedProps); | ||
const { region, queueUrl } = props; | ||
@@ -12,0 +12,0 @@ try { |
@@ -10,3 +10,3 @@ "use strict"; | ||
const toBeAtState = async function (props, expected) { | ||
(0, common_1.verifyProps)(Object.assign(Object.assign({}, props), { state: expected }), stepFunctions_1.expectedProps); | ||
(0, common_1.verifyProps)({ ...props, state: expected }, stepFunctions_1.expectedProps); | ||
const { region, stateMachineArn } = props; | ||
@@ -46,3 +46,3 @@ try { | ||
const toHaveState = async function (props, expected) { | ||
(0, common_1.verifyProps)(Object.assign(Object.assign({}, props), { state: expected }), stepFunctions_1.expectedProps); | ||
(0, common_1.verifyProps)({ ...props, state: expected }, stepFunctions_1.expectedProps); | ||
const { region, stateMachineArn } = props; | ||
@@ -49,0 +49,0 @@ try { |
@@ -8,3 +8,3 @@ "use strict"; | ||
keySchema.map((key) => { | ||
itemKey = Object.assign(Object.assign({}, itemKey), { [key.AttributeName]: item[key.AttributeName] }); | ||
itemKey = { ...itemKey, [key.AttributeName]: item[key.AttributeName] }; | ||
}); | ||
@@ -11,0 +11,0 @@ return itemKey; |
@@ -8,3 +8,6 @@ "use strict"; | ||
const lambdaPayload = payload ? { Payload: JSON.stringify(payload) } : {}; | ||
const params = Object.assign({ FunctionName: functionName }, lambdaPayload); | ||
const params = { | ||
FunctionName: functionName, | ||
...lambdaPayload, | ||
}; | ||
const { Payload } = await lambda.invoke(params).promise(); | ||
@@ -11,0 +14,0 @@ if (Payload) { |
@@ -7,3 +7,7 @@ "use strict"; | ||
const s3 = new AWS.S3({ region }); | ||
const opts = Object.assign({ Bucket: bucket, ContinuationToken: token }, (prefix && { Prefix: prefix })); | ||
const opts = { | ||
Bucket: bucket, | ||
ContinuationToken: token, | ||
...(prefix && { Prefix: prefix }), | ||
}; | ||
const data = await s3.listObjectsV2(opts).promise(); | ||
@@ -10,0 +14,0 @@ let allKeys = data.Contents || []; |
@@ -7,3 +7,7 @@ "use strict"; | ||
const stepFunctions = new AWS.StepFunctions({ region }); | ||
const opts = Object.assign({ maxResults: 1, stateMachineArn }, (statusFilter && { statusFilter })); | ||
const opts = { | ||
maxResults: 1, | ||
stateMachineArn, | ||
...(statusFilter && { statusFilter }), | ||
}; | ||
const result = await stepFunctions.listExecutions(opts).promise(); | ||
@@ -10,0 +14,0 @@ const { executions } = result; |
{ | ||
"name": "aws-testing-library", | ||
"version": "1.1.6", | ||
"version": "2.0.0", | ||
"description": "Chai and Jest matchers for aws services", | ||
@@ -70,3 +70,3 @@ "scripts": { | ||
"axios": "^0.25.0", | ||
"filter-obj": "^2.0.1", | ||
"filter-obj": "^3.0.0", | ||
"jest-diff": "^27.0.0", | ||
@@ -76,4 +76,4 @@ "uuid": "^8.0.0" | ||
"engines": { | ||
"node": ">=v8.17.0" | ||
"node": "^12.20.0 || ^14.14.0 || >=16.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1408
104602
+ Addedfilter-obj@3.0.0(transitive)
- Removedfilter-obj@2.0.2(transitive)
Updatedfilter-obj@^3.0.0