@@ -74,22 +74,22 @@ testsuites.forEach(testsuite => {
7474async function testPrimaryKey ( sut , t , name ) {
7575 // Test one key
7676 let targetCollection = 'collection/{collectionId}' ;
77- let primaryKey = getPrimaryKey ( targetCollection ) ;
77+ let result = getPrimaryKey ( targetCollection ) ;
7878
79- t . is ( primaryKey , 'collectionId' ) ;
79+ t . true ( result . hasPrimaryKey ) ;
80+ t . is ( result . primaryKey , 'collectionId' ) ;
8081
8182 // Test two keys
8283 targetCollection = 'collection/{collectionId}/some_detail/{detailId}' ;
83- primaryKey = getPrimaryKey ( targetCollection ) ;
84- t . is ( primaryKey , 'detailId' ) ;
84+ result = getPrimaryKey ( targetCollection ) ;
85+ t . true ( result . hasPrimaryKey ) ;
86+ t . is ( result . primaryKey , 'detailId' ) ;
8587
8688 // Test missing key
8789 targetCollection = 'collection' ;
88-
89- const error = t . throws ( ( ) => {
90- getPrimaryKey ( targetCollection ) ;
91- } ) ;
92- t . is ( error . message , 'integrify: Missing a primary key in the source' ) ;
90+ result = getPrimaryKey ( targetCollection ) ;
91+ t . false ( result . hasPrimaryKey ) ;
92+ t . is ( result . primaryKey , 'masterId' ) ;
9393
9494 await t . pass ( ) ;
9595}
@@ -430,7 +430,10 @@ async function testDeleteMissingSourceCollectionKey(sut, t, name) {
430430 } ) ;
431431 } ) ;
432432
433- t . is ( error . message , 'integrify: Missing a primary key in the source' ) ;
433+ t . is (
434+ error . message ,
435+ 'integrify: Missing a primary key [masterId] in the source params'
436+ ) ;
434437
435438 // Assert pre-hook was called (only for rules-in-situ)
436439 if ( name === 'rules-in-situ' ) {
0 commit comments