Skip to content

Commit

Permalink
chore: fix tslint errors regarding shadow variables
Browse files Browse the repository at this point in the history
fix tslint errors regarding shadow variables
  • Loading branch information
emonddr committed Apr 24, 2019
1 parent 11b165e commit 6c8617f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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['[email protected]'].user.email);
expect(email).to.equal(test_users.list['[email protected]'].user.email);
});

it('returns error due to expired token', async () => {
Expand Down Expand Up @@ -363,7 +363,7 @@ describe('JWT Authentication', () => {
.bind(JWTAuthenticationStrategyBindings.TOKEN_SERVICE)
.toClass(JWTService);

users = new UserRepository({
test_users = new UserRepository({
'[email protected]': {
user: {
id: '1',
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand Down

0 comments on commit 6c8617f

Please sign in to comment.