diff --git a/packages/authentication/src/__tests__/acceptance/jwt-auth-extension.acceptance.ts b/packages/authentication/src/__tests__/acceptance/jwt-auth-extension.acceptance.ts index c088845178bc..14230f016411 100644 --- a/packages/authentication/src/__tests__/acceptance/jwt-auth-extension.acceptance.ts +++ b/packages/authentication/src/__tests__/acceptance/jwt-auth-extension.acceptance.ts @@ -37,7 +37,7 @@ const SequenceActions = RestBindings.SequenceActions; describe('JWT Authentication', () => { let app: Application; let server: RestServer; - let users: UserRepository; + let test_users: UserRepository; beforeEach(givenAServer); beforeEach(givenAuthenticatedSequence); @@ -87,19 +87,19 @@ describe('JWT Authentication', () => { app.controller(InfoController); - const token: string = (await whenIMakeRequestTo(server) + const the_token: string = (await whenIMakeRequestTo(server) .get('/login') .expect(200)).text; - expect(token).to.be.not.Null; - expect(token).to.be.String; + expect(the_token !== null).to.equal(true); + expect(typeof the_token === 'string').to.equal(true); const email = (await whenIMakeRequestTo(server) .get('/whoAmI') - .set('access_token', token) + .set('access_token', the_token) .expect(200)).text; - expect(email).to.equal(users.list['joe@example.com'].user.email); + expect(email).to.equal(test_users.list['joe@example.com'].user.email); }); it('returns error due to expired token', async () => { @@ -363,7 +363,7 @@ describe('JWT Authentication', () => { .bind(JWTAuthenticationStrategyBindings.TOKEN_SERVICE) .toClass(JWTService); - users = new UserRepository({ + test_users = new UserRepository({ 'joe@example.com': { user: { id: '1', @@ -402,7 +402,7 @@ describe('JWT Authentication', () => { }, }); - server.bind(USER_REPO).to(users); + server.bind(USER_REPO).to(test_users); } function whenIMakeRequestTo(restServer: RestServer): Client { diff --git a/packages/authentication/src/__tests__/fixtures/services/basic-auth-user-service.ts b/packages/authentication/src/__tests__/fixtures/services/basic-auth-user-service.ts index 31a10bd3176f..4e2fd6688337 100644 --- a/packages/authentication/src/__tests__/fixtures/services/basic-auth-user-service.ts +++ b/packages/authentication/src/__tests__/fixtures/services/basic-auth-user-service.ts @@ -34,7 +34,7 @@ export class BasicAuthenticationUserService throw new HttpErrors.Unauthorized(`'credentials.password' is null`); } //if - const foundUser = await this.userRepository.find( + const foundUser = this.userRepository.find( credentials.email, credentials.password, );