Skip to content

Commit

Permalink
feat: types and tests improvements (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
onhate authored Nov 30, 2023
1 parent a7ed56b commit 6d1a6b7
Show file tree
Hide file tree
Showing 7 changed files with 1,071 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Node.js Package

on:
release:
types: [created]
types: [published]

jobs:
build:
Expand Down
61 changes: 61 additions & 0 deletions jest-dynamodb-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
module.exports = {
port: 5002,
options: ['-sharedDb', '-inMemory'],
tables: [
{
TableName: 'onetable',
BillingMode: 'PAY_PER_REQUEST',
AttributeDefinitions: [
{ AttributeName: 'pk', AttributeType: 'S' },
{ AttributeName: 'sk', AttributeType: 'S' },
{ AttributeName: 'gsi1pk', AttributeType: 'S' },
{ AttributeName: 'gsi1sk', AttributeType: 'S' },
{ AttributeName: 'gsi2pk', AttributeType: 'S' },
{ AttributeName: 'gsi2sk', AttributeType: 'S' },
{ AttributeName: 'lsi1sk', AttributeType: 'S' }
],
KeySchema: [
{ AttributeName: 'pk', KeyType: 'HASH' },
{ AttributeName: 'sk', KeyType: 'RANGE' }
],
GlobalSecondaryIndexes: [
{
IndexName: 'gsi1',
KeySchema: [
{ AttributeName: 'gsi1pk', KeyType: 'HASH' },
{ AttributeName: 'gsi1sk', KeyType: 'RANGE' }
],
Projection: {
ProjectionType: 'ALL'
}
},
{
IndexName: 'gsi2',
KeySchema: [
{ AttributeName: 'gsi2pk', KeyType: 'HASH' },
{ AttributeName: 'gsi2sk', KeyType: 'RANGE' }
],
Projection: {
ProjectionType: 'ALL'
}
}
],
LocalSecondaryIndexes: [
{
IndexName: 'lsi1',
KeySchema: [
{ AttributeName: 'pk', KeyType: 'HASH' },
{ AttributeName: 'lsi1sk', KeyType: 'RANGE' }
],
Projection: {
ProjectionType: 'ALL'
}
}
],
StreamSpecification: {
StreamEnabled: true,
StreamViewType: 'NEW_AND_OLD_IMAGES'
}
}
]
};
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
preset: '@shelf/jest-dynamodb',
testEnvironment: 'node',
restoreMocks: true,
clearMocks: true,
Expand Down
Loading

0 comments on commit 6d1a6b7

Please sign in to comment.