@@ -14,26 +14,25 @@ config.allowedAccountPattern = "authTest.*";
1414describe ( 'authTests' , ( ) => {
1515
1616
17- before ( async ( ) => {
17+ beforeAll ( async ( ) => {
1818 await db . getConn ( ) . queryPromise ( "DELETE FROM users WHERE accountId LIKE ?" , [ "authTest%" ] ) ;
1919 await db . getConn ( ) . queryPromise ( "DELETE FROM teams WHERE name LIKE ?" , [ "authTest%" ] ) ;
2020 } ) ;
2121
22- describe ( '#processAuthCallback' , async ( ) => {
22+ describe ( '#processAuthCallback' , ( ) => {
2323
2424 var teamOwner = null ;
2525 var team = null ;
2626
27- before ( async ( ) => {
28-
27+ beforeAll ( async ( ) => {
2928
3029 await db . getPromise ( db . insertUser , { accountId :"authTestTeamOwner" , familyName :"Owner" , givenName :"Team" } ) ;
3130 teamOwner = await db . getPromise ( db . getUser , "authTestTeamOwner" ) ;
3231 await db . getPromise ( db . insertTeam , [ teamOwner , { name :"authTestTeam" } ] ) ;
3332 team = await db . getPromise ( db . getTeamWithMembersByName , "authTestTeam" ) ;
3433 } ) ;
3534
36- it ( 'should create a new user without a team' , async ( ) => {
35+ test ( 'should create a new user without a team' , async ( ) => {
3736 await db . getConn ( ) . queryPromise ( "DELETE FROM users WHERE accountId = ?" , [ "authTestUser" ] ) ;
3837
3938 config . defaultTeam = null ;
@@ -50,7 +49,7 @@ describe('authTests', () => {
5049 return promise ;
5150 } ) ;
5251
53- it ( 'should create a new user and assign it to the default team' , async ( ) => {
52+ test ( 'should create a new user and assign it to the default team' , async ( ) => {
5453 await db . getConn ( ) . queryPromise ( "DELETE FROM users WHERE accountId = ?" , [ "authTestUser" ] ) ;
5554 config . defaultTeam = "authTestTeam" ;
5655 var promise = new Promise ( ( resolve , reject ) => {
@@ -66,7 +65,7 @@ describe('authTests', () => {
6665 return promise ;
6766 } ) ;
6867
69- it ( 'should retrieve and return an existing user' , async ( ) => {
68+ test ( 'should retrieve and return an existing user' , async ( ) => {
7069 await db . getConn ( ) . queryPromise ( "DELETE FROM users WHERE accountId = ?" , [ "authTestUser" ] ) ;
7170 config . defaultTeam = "someOtherTeam" ;
7271 var promise = new Promise ( ( resolve , reject ) => {
@@ -82,7 +81,7 @@ describe('authTests', () => {
8281 return promise ;
8382 } ) ;
8483
85- it ( 'should reject a profileId if is not allowed' , async ( ) => {
84+ test ( 'should reject a profileId if is not allowed' , async ( ) => {
8685 var promise = new Promise ( ( resolve , reject ) => {
8786 auth . processAuthCallback ( "userNotMatchingAllowedPattern" , "A" , "B" , "[email protected] " , ( e , u ) => { 8887 resolve ( e ) ;
@@ -95,7 +94,7 @@ describe('authTests', () => {
9594 return promise ;
9695 } ) ;
9796
98- after ( async ( ) => {
97+ afterAll ( async ( ) => {
9998 await db . getPromise ( db . deleteTeam , [ teamOwner , team . id ] ) ;
10099 await db . getPromise ( db . deleteUser , "authTestNewUser" ) ;
101100 await db . getPromise ( db . deleteUser , "authTestTeamOwner" ) ;
@@ -105,7 +104,7 @@ describe('authTests', () => {
105104 } ) ;
106105
107106
108- after ( async ( ) => {
107+ afterAll ( async ( ) => {
109108 //cleanup
110109 await db . getConn ( ) . queryPromise ( "DELETE FROM users WHERE accountId LIKE ?" , [ "authTest%" ] ) ;
111110 await db . getConn ( ) . queryPromise ( "DELETE FROM teams WHERE name LIKE ?" , [ "authTest%" ] ) ;
0 commit comments