Skip to content

Commit

Permalink
Merge pull request #10871 from qmonmert/fix/10861
Browse files Browse the repository at this point in the history
Eslint errors on generated angularoauth2app
  • Loading branch information
murdos authored Sep 16, 2024
2 parents a0c1479 + d8a6d9d commit 2dfc80c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export default tseslint.config(
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/restrict-template-expressions': ['error', { allowNumber: true }],
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('httpAuthInterceptor', () => {

describe('Bearer Token', () => {
it('should add authorization bearer token in request when defined', async () => {
it('should add authorization bearer token in request when defined', () => {
jest.spyOn(oauth2AuthService, 'token', 'get').mockReturnValue(TOKEN);
const originalRequest = buildHttpRequest();
Expand All @@ -45,7 +45,7 @@ describe('httpAuthInterceptor', () => {
expect(req.request.headers.get('Authorization')).toEqual(`Bearer ${TOKEN}`);
});

it('should not add authorization bearer token in request when it is not defined', async () => {
it('should not add authorization bearer token in request when it is not defined', () => {
jest.spyOn(oauth2AuthService, 'token', 'get').mockReturnValue(undefined);
const originalRequest: HttpRequest<unknown> = buildHttpRequest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ describe('Oauth2 Auth Service', () => {
service = TestBed.inject(Oauth2AuthService);
keycloakInstance = new Keycloak();

consoleDebugMock = jest.spyOn(console, 'debug').mockImplementation(() => {});
consoleErrorMock = jest.spyOn(console, 'error').mockImplementation(() => {});
consoleDebugMock = jest.spyOn(console, 'debug').mockImplementation();
consoleErrorMock = jest.spyOn(console, 'error').mockImplementation();
});

afterEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ export class Oauth2AuthService {
console.debug(`Token not refreshed, valid for ${Math.round(exp + timeSkew - Date.now() / 1000)} seconds`);
}
})
.catch(e => console.error('Failed to refresh token: ' + e));
.catch(e => console.error(`Failed to refresh token: ${e}`));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('LoginComponent', () => {
});

it('should logout on click on logout button', () => {
jest.spyOn(oauth2AuthService, 'logout').mockImplementation(() => {});
jest.spyOn(oauth2AuthService, 'logout').mockImplementation();
fixture.debugElement.query(By.css('#btn-logout')).nativeElement.click();
Expand Down

0 comments on commit 2dfc80c

Please sign in to comment.