Skip to content

Commit

Permalink
fix(indent): Fix indent
Browse files Browse the repository at this point in the history
close #241
  • Loading branch information
Retro64 committed Dec 13, 2019
1 parent f8a2a5b commit ccc5f65
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions test/unit/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,49 +27,37 @@ describe('oauth tooling', () => {
it('if credentialsDir is not defined', () => {
const brokenConfig = {...config, credentialsDir: undefined} as unknown as OAuthConfig;

expect(getAccessToken.bind(undefined,
brokenConfig
)).to.throw(TypeError);
expect(getAccessToken.bind(undefined, brokenConfig)).to.throw(TypeError);
});

it('if accessTokenEndpoint is not defined', () => {
const brokenConfig = {...config, accessTokenEndpoint: undefined} as unknown as OAuthConfig;

expect(getAccessToken.bind(undefined,
brokenConfig
)).to.throw(TypeError);
expect(getAccessToken.bind(undefined, brokenConfig)).to.throw(TypeError);
});

it('if grantType is not defined', () => {
const brokenConfig = {...config, grantType: undefined} as unknown as OAuthConfig;

expect(getAccessToken.bind(undefined,
brokenConfig
)).to.throw(TypeError);
expect(getAccessToken.bind(undefined, brokenConfig)).to.throw(TypeError);
});

it('if redirectUri is not defined (in case of Authorization Code Grant)', () => {
const brokenConfig = {...config, redirectUri: undefined} as unknown as OAuthConfig;

expect(getAccessToken.bind(undefined,
brokenConfig
)).to.throw(TypeError);
expect(getAccessToken.bind(undefined, brokenConfig)).to.throw(TypeError);
});

it('if code is not defined (in case of Authorization Code Grant)', () => {
const brokenConfig = {...config, code: undefined} as unknown as OAuthConfig;

expect(getAccessToken.bind(undefined,
brokenConfig
)).to.throw(TypeError);
expect(getAccessToken.bind(undefined, brokenConfig)).to.throw(TypeError);
});

it('if refreshToken is not defined (in case of Refresh Token Grant)', () => {
const brokenConfig = {...config, grantType: OAuthGrantType.REFRESH_TOKEN_GRANT} as unknown as OAuthConfig;

expect(getAccessToken.bind(undefined,
brokenConfig
)).to.throw(TypeError);
expect(getAccessToken.bind(undefined, brokenConfig)).to.throw(TypeError);
});
});

Expand Down

0 comments on commit ccc5f65

Please # to comment.