Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jeskew committed Apr 7, 2019
1 parent 0d10134 commit 50b35cd
Show file tree
Hide file tree
Showing 14 changed files with 118 additions and 108 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,5 +1,6 @@
yarn.lock
package-lock.json
.idea/

# Created by .ignore support plugin (hsz.mobi)
logs
Expand Down
13 changes: 7 additions & 6 deletions package.json
Expand Up @@ -13,12 +13,12 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^23",
"@types/jest": "^24",
"@types/node": "^8.0.4",
"jest": "^23",
"lerna": "^2.11.0",
"typedoc": "^0.11.0",
"typescript": "^2.7"
"jest": "^24",
"lerna": "^3.13",
"typedoc": "^0.14.0",
"typescript": "^3.4"
},
"dependencies": {
"aws-sdk": "^2.7.0"
Expand All @@ -27,6 +27,7 @@
"packages/*"
],
"jest": {
"testEnvironment": "node"
"testEnvironment": "node",
"testPathIgnorePatterns": ["/node_modules/", ".ts"]
}
}
12 changes: 6 additions & 6 deletions packages/dynamodb-auto-marshaller/package.json
Expand Up @@ -20,25 +20,25 @@
"docs": "typedoc src",
"prepublishOnly": "tsc",
"pretest": "tsc -p tsconfig.test.json",
"test": "jest"
"test": "jest \"build/(.+).spec.js\""
},
"author": {
"name": "AWS SDK for JavaScript Team",
"email": "aws-sdk-js@amazon.com"
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^23",
"@types/jest": "^24",
"@types/node": "^8.0.4",
"aws-sdk": "^2.7.0",
"jest": "^23",
"typedoc": "^0.11.0",
"typescript": "^2.7"
"jest": "^24",
"typedoc": "^0.14.0",
"typescript": "^3.4"
},
"peerDependencies": {
"aws-sdk": "^2.7.0"
},
"dependencies": {
"tslib": "^1.8.1"
"tslib": "^1.9"
}
}
12 changes: 6 additions & 6 deletions packages/dynamodb-batch-iterator/package.json
Expand Up @@ -20,26 +20,26 @@
"docs": "typedoc src",
"prepublishOnly": "tsc",
"pretest": "tsc -p tsconfig.test.json",
"test": "jest"
"test": "jest \"build/(.+).spec.js\""
},
"author": {
"name": "AWS SDK for JavaScript Team",
"email": "aws-sdk-js@amazon.com"
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^23",
"@types/jest": "^24",
"@types/node": "^8.0.4",
"aws-sdk": "^2.7.0",
"jest": "^23",
"typedoc": "^0.11.0",
"typescript": "^2.7"
"jest": "^24",
"typedoc": "^0.14.0",
"typescript": "^3.4"
},
"peerDependencies": {
"aws-sdk": "^2.7.0"
},
"dependencies": {
"tslib": "^1.8.1",
"tslib": "^1.9",
"utf8-bytes": "^0.0.1"
}
}
25 changes: 13 additions & 12 deletions packages/dynamodb-batch-iterator/src/BatchGet.spec.ts
@@ -1,14 +1,14 @@
import { BatchGet, MAX_READ_BATCH_SIZE } from './BatchGet';
import { AttributeMap, BatchGetItemOutput } from 'aws-sdk/clients/dynamodb';
import {AttributeMap, BatchGetItemInput, BatchGetItemOutput} from 'aws-sdk/clients/dynamodb';

describe('BatchGet', () => {
const promiseFunc = jest.fn(() => Promise.resolve({
UnprocessedItems: {}
}));
UnprocessedKeys: {}
} as BatchGetItemOutput));
const mockDynamoDbClient = {
config: {},
batchGetItem: jest.fn(() => ({promise: promiseFunc})),
};
} as any;

beforeEach(() => {
promiseFunc.mockClear();
Expand Down Expand Up @@ -279,7 +279,7 @@ describe('BatchGet', () => {
const buzz = { S: 'Static string' };
const response: BatchGetItemOutput = {};

const {RequestItems} = mockDynamoDbClient.batchGetItem.mock.calls.slice(-1)[0][0];
const {RequestItems} = (mockDynamoDbClient.batchGetItem.mock.calls.slice(-1)[0] as any)[0];
for (const tableName of Object.keys(RequestItems)) {
for (const item of RequestItems[tableName].Keys) {
if (toBeFailed.has(item.fizz.N)) {
Expand Down Expand Up @@ -310,7 +310,7 @@ describe('BatchGet', () => {
}
}

return response;
return Promise.resolve(response);
});

const input = asyncInput
Expand Down Expand Up @@ -348,8 +348,7 @@ describe('BatchGet', () => {
const {calls} = mockDynamoDbClient.batchGetItem.mock;
expect(calls.length).toBe(Math.ceil(gets.length / MAX_READ_BATCH_SIZE));


const callCount: {[key: string]: number} = calls.reduce(
const callCount: {[key: string]: number} = (calls as Array<Array<BatchGetItemInput>>).reduce(
(
keyUseCount: {[key: string]: number},
[{RequestItems}]
Expand All @@ -359,10 +358,12 @@ describe('BatchGet', () => {
keys.push(...RequestItems[table].Keys);
}
for (const {fizz: {N: key}} of keys) {
if (key in keyUseCount) {
keyUseCount[key]++;
} else {
keyUseCount[key] = 1;
if (key) {
if (key in keyUseCount) {
keyUseCount[key]++;
} else {
keyUseCount[key] = 1;
}
}
}

Expand Down
12 changes: 6 additions & 6 deletions packages/dynamodb-batch-iterator/src/BatchWrite.spec.ts
@@ -1,11 +1,11 @@
import { BatchWrite, MAX_WRITE_BATCH_SIZE } from './BatchWrite';
import { WriteRequest } from './types';
import { BatchWriteItemOutput } from 'aws-sdk/clients/dynamodb';
import {BatchWriteItemInput, BatchWriteItemOutput} from 'aws-sdk/clients/dynamodb';

describe('BatchWrite', () => {
const promiseFunc = jest.fn(() => Promise.resolve({
UnprocessedItems: {}
}));
} as BatchWriteItemOutput));
const mockDynamoDbClient = {
config: {},
batchWriteItem: jest.fn(() => ({promise: promiseFunc})),
Expand Down Expand Up @@ -138,10 +138,10 @@ describe('BatchWrite', () => {
}
}

promiseFunc.mockImplementation(() => {
promiseFunc.mockImplementation(async () => {
const response: BatchWriteItemOutput = {};

const {RequestItems} = mockDynamoDbClient.batchWriteItem.mock.calls.slice(-1)[0][0];
const {RequestItems} = (mockDynamoDbClient.batchWriteItem.mock.calls.slice(-1)[0] as any)[0];
for (const tableName of Object.keys(RequestItems)) {
for (const {DeleteRequest, PutRequest} of RequestItems[tableName]) {
const item = DeleteRequest ? DeleteRequest.Key : PutRequest.Item;
Expand Down Expand Up @@ -201,7 +201,7 @@ describe('BatchWrite', () => {
expect(calls.length)
.toBe(Math.ceil(writes.length / MAX_WRITE_BATCH_SIZE));

const callCount: {[key: string]: number} = calls.reduce(
const callCount: {[key: string]: number} = (calls as Array<Array<BatchWriteItemInput>>).reduce(
(
keyUseCount: {[key: string]: number},
[{RequestItems}]
Expand All @@ -210,7 +210,7 @@ describe('BatchWrite', () => {
for (const {PutRequest, DeleteRequest} of RequestItems[table]) {
let key = DeleteRequest
? DeleteRequest.Key.fizz.N
: PutRequest.Item.fizz.N;
: (PutRequest as any).Item.fizz.N;
if (key in keyUseCount) {
keyUseCount[key]++;
} else {
Expand Down
12 changes: 6 additions & 6 deletions packages/dynamodb-data-mapper-annotations/package.json
Expand Up @@ -22,28 +22,28 @@
"integ": "npm run pretest && jest --config=jest.integration.js",
"prepublishOnly": "npm run build",
"pretest": "tsc -p tsconfig.test.json",
"test": "jest"
"test": "jest \"build/(.+).spec.js\""
},
"author": {
"name": "AWS SDK for JavaScript Team",
"email": "aws-sdk-js@amazon.com"
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^23",
"@types/jest": "^24",
"@types/node": "^8.0.4",
"@types/uuid": "^3.0.0",
"aws-sdk": "^2.7.0",
"jest": "^23",
"typedoc": "^0.11.0",
"typescript": "^2.7"
"jest": "^24",
"typedoc": "^0.14.0",
"typescript": "^3.4"
},
"dependencies": {
"@aws/dynamodb-auto-marshaller": "^0.7.1",
"@aws/dynamodb-data-mapper": "^0.7.3",
"@aws/dynamodb-data-marshaller": "^0.7.3",
"reflect-metadata": "^0.1.10",
"tslib": "^1.8.1",
"tslib": "^1.9",
"uuid": "^3.0.0"
}
}
Expand Up @@ -66,7 +66,7 @@ describe('annotations', () => {

await mapper.put(post);

expect(mockDynamoDbClient.putItem.mock.calls[0][0])
expect((mockDynamoDbClient.putItem.mock.calls[0] as any)[0])
.toMatchObject({
ConditionExpression: 'attribute_not_exists(#attr0)',
ExpressionAttributeNames: {'#attr0': 'version'},
Expand Down
12 changes: 6 additions & 6 deletions packages/dynamodb-data-mapper/package.json
Expand Up @@ -22,28 +22,28 @@
"integ": "npm run pretest && jest --config=jest.integration.js",
"prepublishOnly": "npm run build",
"pretest": "tsc -p tsconfig.test.json",
"test": "jest"
"test": "jest \"build/(.+).spec.js\""
},
"author": {
"name": "AWS SDK for JavaScript Team",
"email": "aws-sdk-js@amazon.com"
},
"license": "Apache-2.0",
"devDependencies": {
"@types/jest": "^23",
"@types/jest": "^24",
"@types/node": "^8.0.4",
"aws-sdk": "^2.7.0",
"jest": "^23",
"typedoc": "^0.11.0",
"typescript": "^2.7"
"jest": "^24",
"typedoc": "^0.14.0",
"typescript": "^3.4"
},
"dependencies": {
"@aws/dynamodb-auto-marshaller": "^0.7.1",
"@aws/dynamodb-batch-iterator": "^0.7.1",
"@aws/dynamodb-data-marshaller": "^0.7.3",
"@aws/dynamodb-expressions": "^0.7.3",
"@aws/dynamodb-query-iterator": "^0.7.1",
"tslib": "^1.8.1"
"tslib": "^1.9"
},
"peerDependencies": {
"aws-sdk": "^2.7.0"
Expand Down

0 comments on commit 50b35cd

Please sign in to comment.