@@ -79,6 +79,7 @@ describe(`#integration - recovery phone`, function () {
7979 await db . deleteFrom ( 'accounts' ) . execute ( ) ;
8080 await db . deleteFrom ( 'recoveryPhones' ) . execute ( ) ;
8181 await db . deleteFrom ( 'sessionTokens' ) . execute ( ) ;
82+ await db . deleteFrom ( 'recoveryCodes' ) . execute ( ) ;
8283 }
8384
8485 beforeEach ( async function ( ) {
@@ -92,6 +93,15 @@ describe(`#integration - recovery phone`, function () {
9293 version : 'V2' ,
9394 }
9495 ) ;
96+
97+ // Add totp to account
98+ client . totpAuthenticator = new otplib . authenticator . Authenticator ( ) ;
99+ const totpResult = await client . createTotpToken ( ) ;
100+ client . totpAuthenticator . options = {
101+ secret : totpResult . secret ,
102+ crypto : crypto ,
103+ } ;
104+ await client . verifyTotpCode ( client . totpAuthenticator . generate ( ) ) ;
95105 } ) ;
96106
97107 afterEach ( async function ( ) {
@@ -123,15 +133,6 @@ describe(`#integration - recovery phone`, function () {
123133 this . skip ( 'Invalid twilio accountSid or authToken. Check env / config!' ) ;
124134 }
125135
126- // Add totp to account
127- client . totpAuthenticator = new otplib . authenticator . Authenticator ( ) ;
128- const totpResult = await client . createTotpToken ( ) ;
129- client . totpAuthenticator . options = {
130- secret : totpResult . secret ,
131- crypto : crypto ,
132- } ;
133- await client . verifyTotpCode ( client . totpAuthenticator . generate ( ) ) ;
134-
135136 // Add recovery phone
136137 await client . recoveryPhoneNumberCreate ( phoneNumber ) ;
137138 await client . recoveryPhoneConfirmSetup (
0 commit comments