@@ -377,6 +377,8 @@ describe('AuthenticationProviders', function () {
377
377
const authDataSpy = spyOn ( adapter , 'validateAuthData' ) . and . callThrough ( ) ;
378
378
const appIdSpy = spyOn ( adapter , 'validateAppId' ) . and . callThrough ( ) ;
379
379
380
+ await reconfigureServer ( { auth : { customAuthentication : adapter } } ) ;
381
+
380
382
const authenticationHandler = authenticationLoader ( {
381
383
customAuthentication : adapter ,
382
384
} ) ;
@@ -392,6 +394,14 @@ describe('AuthenticationProviders', function () {
392
394
} ) ;
393
395
394
396
it ( 'properly loads custom adapter module object' , async ( ) => {
397
+ await reconfigureServer ( {
398
+ auth : {
399
+ customAuthentication : {
400
+ validateAppId ( ) { } ,
401
+ validateAuthData ( ) { } ,
402
+ } ,
403
+ } ,
404
+ } ) ;
395
405
const authenticationHandler = authenticationLoader ( ) ;
396
406
397
407
validateAuthenticationHandler ( authenticationHandler ) ;
@@ -406,27 +416,27 @@ describe('AuthenticationProviders', function () {
406
416
) ;
407
417
} ) ;
408
418
409
- it ( 'properly loads custom adapter module object (again)' , done => {
419
+ it ( 'properly loads custom adapter module object (again)' , async ( ) => {
420
+ await reconfigureServer ( {
421
+ auth : {
422
+ customAuthentication : {
423
+ validateAppId ( ) { } ,
424
+ validateAuthData ( ) { } ,
425
+ } ,
426
+ } ,
427
+ } ) ;
410
428
const authenticationHandler = authenticationLoader ( ) ;
411
429
412
430
validateAuthenticationHandler ( authenticationHandler ) ;
413
431
const { validator } = authenticationHandler . getValidatorForProvider ( 'customAuthentication' ) ;
414
432
validateValidator ( validator ) ;
415
433
416
- validator (
434
+ await validator (
417
435
{
418
436
token : 'valid-token' ,
419
437
} ,
420
438
{ } ,
421
439
{ }
422
- ) . then (
423
- ( ) => {
424
- done ( ) ;
425
- } ,
426
- err => {
427
- jfail ( err ) ;
428
- done ( ) ;
429
- }
430
440
) ;
431
441
} ) ;
432
442
0 commit comments