File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -147,11 +147,12 @@ const users = (connection: ConnectionREST): Users => {
147147const db = ( connection : ConnectionREST ) : DBUsers => {
148148 const ns = namespacedUsers ( connection ) ;
149149
150- /** expectCode returns true if the error contained an expected status code. */
150+ /** expectCode returns false if the contained WeaviateUnexpectedStatusCodeError
151+ * has an known error code and rethrows the error otherwise. */
151152 const expectCode = ( code : number ) : ( ( _ : any ) => boolean ) => {
152153 return ( error ) => {
153- if ( error instanceof WeaviateUnexpectedStatusCodeError ) {
154- return error . code === code ;
154+ if ( error instanceof WeaviateUnexpectedStatusCodeError && error . code === code ) {
155+ return false ;
155156 }
156157 throw error ;
157158 } ;
Original file line number Diff line number Diff line change @@ -79,13 +79,13 @@ requireAtLeast(
7979 await expectDave ( ) . toHaveProperty ( 'active' , true ) ;
8080
8181 // Second activation is a no-op
82- await expect ( client . users . db . activate ( 'dynamic-dave' ) ) . resolves . toEqual ( true ) ;
82+ await expect ( client . users . db . activate ( 'dynamic-dave' ) ) . resolves . toEqual ( false ) ;
8383
8484 await client . users . db . deactivate ( 'dynamic-dave' ) ;
8585 await expectDave ( ) . toHaveProperty ( 'active' , false ) ;
8686
8787 // Second deactivation is a no-op
88- await expect ( client . users . db . deactivate ( 'dynamic-dave' , { revokeKey : true } ) ) . resolves . toEqual ( true ) ;
88+ await expect ( client . users . db . deactivate ( 'dynamic-dave' , { revokeKey : true } ) ) . resolves . toEqual ( false ) ;
8989
9090 await client . users . db . delete ( 'dynamic-dave' ) ;
9191 await expectDave ( false ) . toHaveProperty ( 'code' , 404 ) ;
You can’t perform that action at this time.
0 commit comments