@@ -42,21 +42,22 @@ describe('webex-core', () => {
4242 } )
4343 ) ;
4444
45- beforeEach ( 'create webex instance' , async ( ) => {
45+ beforeEach ( 'create webex instance' , ( ) => {
4646 webex = new WebexCore ( { credentials : { supertoken : webexUser . token } } ) ;
4747 webexEU = new WebexCore ( { credentials : { supertoken : webexUserEU . token } } ) ;
4848 services = webex . internal . services ;
4949 servicesEU = webexEU . internal . services ;
5050 catalog = services . _getCatalog ( ) ;
5151
52- await Promise . all ( [
52+ return Promise . all ( [
5353 services . waitForCatalog ( 'postauth' , 10 ) ,
5454 servicesEU . waitForCatalog ( 'postauth' , 10 ) ,
55- ] ) ;
56- await services . updateServices ( {
57- from : 'limited' ,
58- query : { userId : webexUser . id } ,
59- } )
55+ ] ) . then ( ( ) =>
56+ services . updateServices ( {
57+ from : 'limited' ,
58+ query : { userId : webexUser . id } ,
59+ } )
60+ ) ;
6061 } ) ;
6162
6263 describe ( '#_getCatalog()' , ( ) => {
@@ -86,14 +87,14 @@ describe('webex-core', () => {
8687 let testUrlTemplate ;
8788 let testUrl ;
8889
89- beforeEach ( 'load test url' , async ( ) => {
90+ beforeEach ( 'load test url' , ( ) => {
9091 testUrlTemplate = {
9192 defaultUrl : 'https://www.example.com/api/v1' ,
9293 hosts : [ ] ,
9394 name : 'exampleValid' ,
9495 } ;
9596 testUrl = new ServiceUrl ( testUrlTemplate ) ;
96- await catalog . _loadServiceUrls ( 'preauth' , [ testUrl ] ) ;
97+ catalog . _loadServiceUrls ( 'preauth' , [ testUrl ] ) ;
9798 } ) ;
9899
99100 afterEach ( 'unload test url' , ( ) => {
@@ -531,7 +532,7 @@ describe('webex-core', () => {
531532 let testUrl ;
532533 let testUrlTemplate ;
533534
534- beforeEach ( 'load test url' , async ( ) => {
535+ beforeEach ( 'load test url' , ( ) => {
535536 testUrlTemplate = {
536537 defaultUrl : 'https://www.example.com/api/v1' ,
537538 hosts : [
@@ -552,7 +553,7 @@ describe('webex-core', () => {
552553 name : 'exampleValid' ,
553554 } ;
554555 testUrl = new ServiceUrl ( testUrlTemplate ) ;
555- await catalog . _loadServiceUrls ( 'preauth' , [ testUrl ] ) ;
556+ catalog . _loadServiceUrls ( 'preauth' , [ testUrl ] ) ;
556557 } ) ;
557558
558559 it ( 'converts the url to a priority host url' , ( ) => {
@@ -733,15 +734,18 @@ describe('webex-core', () => {
733734 done ( ) ;
734735 } ) ;
735736 } ) ;
736- it ( 'updates the limited catalog when query param mode is provided' , async ( ) => {
737+ it ( 'updates the limited catalog when query param mode is provided' , ( done ) => {
737738 catalog . serviceGroups . preauth = [ ] ;
738739
739- await services
740+ services
740741 . updateServices ( {
741742 from : 'limited' ,
742743 query : { mode : 'DEFAULT_BY_PROXIMITY' } ,
744+ } )
745+ . then ( ( ) => {
746+ assert . isAbove ( catalog . serviceGroups . preauth . length , 0 ) ;
747+ done ( ) ;
743748 } ) ;
744- assert . isAbove ( catalog . serviceGroups . preauth . length , 0 ) ;
745749 } ) ;
746750 it ( 'does not update the limited catalog when nothing is provided' , ( ) => {
747751 catalog . serviceGroups . preauth = [ ] ;
@@ -789,12 +793,11 @@ describe('webex-core', () => {
789793 } ) ;
790794
791795 describe ( '#fetchClientRegionInfo()' , ( ) => {
792- it ( 'returns client region info' , async ( ) => {
796+ it ( 'returns client region info' , ( ) =>
793797 services . fetchClientRegionInfo ( ) . then ( ( r ) => {
794798 assert . isDefined ( r . countryCode ) ;
795799 assert . isDefined ( r . timezone ) ;
796- } )
797- } ) ;
800+ } ) ) ;
798801 } ) ;
799802
800803 describe ( '#validateUser()' , ( ) => {
@@ -867,21 +870,21 @@ describe('webex-core', () => {
867870 assert . equal ( Object . keys ( unauthServices . list ( false , 'postauth' ) ) . length , 0 ) ;
868871 } ) ) ;
869872
870- it ( 'validates new user with activationOptions suppressEmail false' , async ( ) => {
871- const r = await unauthServices
873+ it ( 'validates new user with activationOptions suppressEmail false' , ( ) =>
874+ unauthServices
872875 . validateUser ( {
873876 email : `Collabctg+webex-js-sdk-${ uuid . v4 ( ) } @gmail.com` ,
874877 activationOptions : { suppressEmail : false } ,
875- } ) ;
876-
877- assert . hasAllKeys ( r , [ 'activated' , 'exists' , 'user' , 'details' ] ) ;
878- assert . equal ( r . activated , false ) ;
879- assert . equal ( r . exists , false ) ;
880- assert . equal ( r . user . verificationEmailTriggered , true ) ;
881- assert . isAbove ( Object . keys ( unauthServices . list ( false , 'preauth' ) ) . length , 0 ) ;
882- assert . equal ( Object . keys ( unauthServices . list ( false , 'signin' ) ) . length , 0 ) ;
883- assert . equal ( Object . keys ( unauthServices . list ( false , 'postauth' ) ) . length , 0 ) ;
884- } ) ;
878+ } )
879+ . then ( ( r ) => {
880+ assert . hasAllKeys ( r , [ 'activated' , 'exists' , 'user' , 'details' ] ) ;
881+ assert . equal ( r . activated , false ) ;
882+ assert . equal ( r . exists , false ) ;
883+ assert . equal ( r . user . verificationEmailTriggered , true ) ;
884+ assert . isAbove ( Object . keys ( unauthServices . list ( false , 'preauth' ) ) . length , 0 ) ;
885+ assert . equal ( Object . keys ( unauthServices . list ( false , 'signin' ) ) . length , 0 ) ;
886+ assert . equal ( Object . keys ( unauthServices . list ( false , 'postauth' ) ) . length , 0 ) ;
887+ } ) ) ;
885888
886889 it ( 'validates new user with activationOptions suppressEmail true' , ( ) =>
887890 unauthServices
0 commit comments