File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,9 @@ beforeAll(async () => {
7676} )
7777
7878export async function scanWithDocClient ( tableName : string ) {
79- return ( await documentClient . send ( new ScanCommand ( { TableName : tableName } ) ) ) . Items ?? [ ]
79+ return (
80+ ( await documentClient . send ( new ScanCommand ( { TableName : tableName , ConsistentRead : true } ) ) ) . Items ?? [ ]
81+ )
8082}
8183
8284export async function emptyTable ( tableName : string , isCustomTable ?: boolean ) {
@@ -830,17 +832,11 @@ describe('standard single table', () => {
830832 async ( ) =>
831833 await store . transactions
832834 . buildWriteTransaction ( SHEEP_ENTITY )
833- . put ( shaunTheSheep )
834835 . conditionCheck ( bobTheSheep , { conditionExpression : 'attribute_exists(PK)' } )
835836 . execute ( )
836- ) . rejects . toThrowError ( )
837-
838- // Should succeed because bob doesn't exist
839- await store . transactions
840- . buildWriteTransaction ( SHEEP_ENTITY )
841- . put ( shaunTheSheep )
842- . conditionCheck ( bobTheSheep , { conditionExpression : 'attribute_not_exists(PK)' } )
843- . execute ( )
837+ ) . rejects . toThrowError (
838+ 'Transaction cancelled, please refer cancellation reasons for specific reasons [ConditionalCheckFailed]'
839+ )
844840 } )
845841
846842 test ( 'get' , async ( ) => {
You can’t perform that action at this time.
0 commit comments