@@ -2,7 +2,7 @@ import EmailPassword from 'supertokens-node/recipe/emailpassword';
22import Passwordless from 'supertokens-node/recipe/passwordless' ;
33import ThirdParty from 'supertokens-node/recipe/thirdparty' ;
44
5- import { workInBatches , measureTime } from '../common/utils' ;
5+ import { workInBatches , measureTime , FailureTracker } from '../common/utils' ;
66
77const TOTAL_USERS = 10000 ;
88
@@ -16,13 +16,13 @@ const createEmailPasswordUsers = async () => {
1616 . map ( ( ) => String . fromCharCode ( 97 + Math . floor ( Math . random ( ) * 26 ) ) )
1717 . join ( '' ) + '@example.com' ;
1818 const createdUser = await EmailPassword . signUp ( 'public' , email , 'password' ) ;
19- // expect(createdUser.status).toBe("OK");
2019 if ( createdUser . status === 'OK' ) {
2120 return {
2221 recipeUserId : createdUser . recipeUserId . getAsString ( ) ,
2322 email : email ,
2423 } ;
2524 }
25+ FailureTracker . getInstance ( ) . recordFailure ( 'EmailPassword users creation' , createdUser . status ) ;
2626 } ) ;
2727} ;
2828
@@ -38,13 +38,16 @@ const createPasswordlessUsersWithEmail = async () => {
3838 tenantId : 'public' ,
3939 email,
4040 } ) ;
41- // expect(createdUser.status).toBe("OK");
4241 if ( createdUser . status === 'OK' ) {
4342 return {
4443 recipeUserId : createdUser . recipeUserId . getAsString ( ) ,
4544 email,
4645 } ;
4746 }
47+ FailureTracker . getInstance ( ) . recordFailure (
48+ 'Passwordless users (with email) creation' ,
49+ createdUser . status
50+ ) ;
4851 } ) ;
4952} ;
5053
@@ -56,13 +59,16 @@ const createPasswordlessUsersWithPhone = async () => {
5659 tenantId : 'public' ,
5760 phoneNumber,
5861 } ) ;
59- // expect(createdUser.status).toBe("OK");
6062 if ( createdUser . status === 'OK' ) {
6163 return {
6264 recipeUserId : createdUser . recipeUserId . getAsString ( ) ,
6365 phoneNumber,
6466 } ;
6567 }
68+ FailureTracker . getInstance ( ) . recordFailure (
69+ 'Passwordless users (with phone) creation' ,
70+ createdUser . status
71+ ) ;
6672 } ) ;
6773} ;
6874
@@ -85,13 +91,16 @@ const createThirdPartyUsers = async (thirdPartyId: string) => {
8591 email ,
8692 true
8793 ) ;
88- // expect(createdUser.status).toBe("OK");
8994 if ( createdUser . status === 'OK' ) {
9095 return {
9196 recipeUserId : createdUser . recipeUserId . getAsString ( ) ,
9297 email,
9398 } ;
9499 }
100+ FailureTracker . getInstance ( ) . recordFailure (
101+ `ThirdParty users (${ thirdPartyId } ) creation` ,
102+ createdUser . status
103+ ) ;
95104 } ) ;
96105} ;
97106
0 commit comments