44import { Config , Credentials } from 'aws-sdk/global'
55import { resetDynamoEasyConfig } from '../../test/helper/resetDynamoEasyConfig.function'
66import { updateDynamoEasyConfig } from '../config'
7- import { DynamoRx } from './dynamo-rx '
7+ import { DynamoPromisified } from './dynamo-promisified '
88
99describe ( 'dynamo rx' , ( ) => {
1010 describe ( 'should call the validity ensurer before each call and call the correct dynamoDB method' , ( ) => {
11- let dynamoRx : DynamoRx
11+ let dynamoRx : DynamoPromisified
1212 let sessionValidityEnsurerSpy : jasmine . Spy
1313 let dynamoDBSpy : jasmine . Spy
1414 let pseudoParams : any
@@ -17,7 +17,7 @@ describe('dynamo rx', () => {
1717 pseudoParams = { TableName : 'tableName' , KeyConditionExpression : 'blub' }
1818 sessionValidityEnsurerSpy = jasmine . createSpy ( ) . and . returnValue ( Promise . resolve ( ) )
1919 updateDynamoEasyConfig ( { sessionValidityEnsurer : sessionValidityEnsurerSpy } )
20- dynamoRx = new DynamoRx ( )
20+ dynamoRx = new DynamoPromisified ( )
2121 } )
2222
2323 afterEach ( ( ) => {
@@ -79,7 +79,7 @@ describe('dynamo rx', () => {
7979 } )
8080
8181 describe ( 'makeRequest' , async ( ) => {
82- let dynamoRx : DynamoRx
82+ let dynamoRx : DynamoPromisified
8383 let sessionValidityEnsurerSpy : jasmine . Spy
8484 let dynamoDBSpy : jasmine . Spy
8585 let pseudoParams : any
@@ -88,7 +88,7 @@ describe('dynamo rx', () => {
8888 pseudoParams = { TableName : 'tableName' , KeyConditionExpression : 'blub' }
8989 sessionValidityEnsurerSpy = jasmine . createSpy ( ) . and . returnValue ( Promise . resolve ( true ) )
9090 updateDynamoEasyConfig ( { sessionValidityEnsurer : sessionValidityEnsurerSpy } )
91- dynamoRx = new DynamoRx ( )
91+ dynamoRx = new DynamoPromisified ( )
9292 } )
9393
9494 afterEach ( ( ) => {
@@ -107,13 +107,13 @@ describe('dynamo rx', () => {
107107 describe ( 'query' , ( ) => {
108108 beforeEach ( ( ) => { } )
109109 it ( 'should throw when no KeyConditionExpression was given' , ( ) => {
110- const dynamoRx = new DynamoRx ( )
110+ const dynamoRx = new DynamoPromisified ( )
111111 expect ( ( ) => dynamoRx . query ( { TableName : 'tableName' } ) ) . toThrow ( )
112112 } )
113113 } )
114114
115115 it ( 'should call makeRequest with the given params' , async ( ) => {
116- const dynamoRx = new DynamoRx ( )
116+ const dynamoRx = new DynamoPromisified ( )
117117 const makeRequest = jasmine . createSpy ( ) . and . returnValue ( { promise : ( ) => Promise . resolve ( null ) } )
118118 Object . assign ( dynamoRx , { dynamoDB : { makeRequest } } )
119119
@@ -123,7 +123,7 @@ describe('dynamo rx', () => {
123123 } )
124124
125125 it ( 'should update the credentials' , ( ) => {
126- const dynamoRx = new DynamoRx ( )
126+ const dynamoRx = new DynamoPromisified ( )
127127 const credentials = new Credentials ( { secretAccessKey : '' , sessionToken : '' , accessKeyId : '' } )
128128 dynamoRx . updateAwsConfigCredentials ( new Config ( { credentials } ) )
129129 expect ( dynamoRx . dynamoDB . config . credentials ) . toBe ( credentials )
0 commit comments