@@ -17,7 +17,6 @@ describe('Insert Local Collection Tests', function () {
1717 }
1818 } )
1919
20-
2120 it ( 'should fire before and after hooks with correct userId for normal collection in local-only contexts' , async function ( ) {
2221 const collection = new Mongo . Collection ( null )
2322 let beforeUserId = 'not set'
@@ -69,14 +68,14 @@ describe('Insert Local Collection Tests', function () {
6968 it ( 'local collection document should have extra property added before being inserted' , async function ( ) {
7069 const collection = new Mongo . Collection ( null )
7170 const tmp = { }
72-
71+
7372 collection . before . insert ( function ( userId , doc ) {
7473 tmp . typeof_userId = typeof userId
7574 doc . before_insert_value = true
7675 } )
77-
76+
7877 await collection . insertAsync ( { start_value : true } )
79-
78+
8079 if ( Meteor . isServer ) {
8180 expect ( tmp . typeof_userId ) . toBe ( 'undefined' , 'Local collection on server should NOT know about a userId' )
8281 } else {
@@ -87,18 +86,18 @@ describe('Insert Local Collection Tests', function () {
8786
8887 it ( 'local collection should fire after-insert hook' , async function ( ) {
8988 const collection = new Mongo . Collection ( null )
90-
89+
9190 collection . after . insert ( function ( userId , doc ) {
9291 if ( Meteor . isServer ) {
9392 expect ( typeof userId ) . toBe ( 'undefined' , 'Local collection on server should NOT know about a userId' )
9493 } else {
9594 expect ( typeof userId ) . toBe ( 'string' , 'There should be a userId on the client' )
9695 }
97-
96+
9897 expect ( doc . start_value ) . not . toBe ( undefined , 'doc should have start_value' )
9998 expect ( this . _id ) . not . toBe ( undefined , 'should provide inserted _id on this' )
10099 } )
101-
100+
102101 await collection . insertAsync ( { start_value : true } )
103102 } )
104- } )
103+ } )
0 commit comments