Skip to content

Commit

Permalink
style: fix lint violations
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincharity committed May 28, 2019
1 parent eb08352 commit 705e5bf
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ngx-tools/src/jwt-token-managment/effects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ describe(`JWT Token Effects`, function() {
};

test(`should provide a cookie and store cookie message if the cookie is set`, () => {
// tslint:disable-next-line deprecation
const currentState = of<State>(blankState);
mockCookieService.get.mockReturnValue('abcd');

Expand All @@ -114,6 +115,7 @@ describe(`JWT Token Effects`, function() {
});

test(`should emit nothing if state is loaded`, () => {
// tslint:disable-next-line deprecation
const currentState = of<State>({
...blankState,
jwtTokens: {
Expand All @@ -131,6 +133,7 @@ describe(`JWT Token Effects`, function() {
});

test(`should emit nothing if state is empty`, () => {
// tslint:disable-next-line deprecation
const currentState = of<State>({
...blankState,
jwtTokens: {
Expand All @@ -149,6 +152,7 @@ describe(`JWT Token Effects`, function() {
});

it(`it should only announce the initial if the cookie is empty`, () => {
// tslint:disable-next-line deprecation
const currentState = of<State>(blankState);
mockCookieService.get.mockReturnValue('');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe(`TokenEscalator`, function() {
let escalator: TokenEscalator<MockClaimMap>;
let actions: Observable<any>;
const tokenName = 'foo';
// tslint:disable-next-line deprecation
const authorizeUrl = of('/foobar');

beforeEach(() => {
Expand Down Expand Up @@ -56,7 +57,9 @@ describe(`TokenEscalator`, function() {
test(`should dispatch success on a successful response`, () => {
actions = cold('a', {a: new JwtActions.EscalateToken<ClaimMap>(tokenName)});
const responseBody = {token: 'asdfkjlslfd'};
// tslint:disable-next-line deprecation
mockHttp.get.mockReturnValue(of(responseBody));
// tslint:disable-next-line deprecation
mockStore.select.mockReturnValue(of('currentToken'));

(
Expand All @@ -74,7 +77,9 @@ describe(`TokenEscalator`, function() {
test(`should dispatch failed if the token fails to extract`, () => {
actions = cold('a', {a: new JwtActions.EscalateToken<ClaimMap>(tokenName)});
const responseBody = {};
// tslint:disable-next-line deprecation
mockHttp.get.mockReturnValue(of(responseBody));
// tslint:disable-next-line deprecation
mockStore.select.mockReturnValue(of('currentToken'));

(
Expand Down
3 changes: 3 additions & 0 deletions ngx-tools/src/retry-with-backoff/retry-with-backoff.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe(`retryWithBackoff`, function() {
const error = new Error('bar');
const seenValues: {[idx: number]: number} = {};

// tslint:disable-next-line deprecation
of(1, 2, 3).pipe(
tap(v => {
if (!seenValues[v]) {
Expand All @@ -33,6 +34,7 @@ describe(`retryWithBackoff`, function() {
retries: 2,
delayCalculator: linearBackoff,
}),
// tslint:disable-next-line no-any
).subscribe(() => {}, (err: any) => {
expect(err).toEqual(error);
expect(seenValues).toEqual({
Expand All @@ -48,6 +50,7 @@ describe(`retryWithBackoff`, function() {
const error = new Error('bar');
const seenValues: {[idx: number]: number} = {};

// tslint:disable-next-line deprecation
of(1, 2, 3, 4).pipe(
tap(v => {
if (!seenValues[v]) {
Expand Down
2 changes: 1 addition & 1 deletion ngx-tools/src/uuid/uuid.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe(`uuid`, function() {

// Test Validity
if (!uuidRegex.test(newUuid)) {
done.fail(new Error('This is the error'));
done.fail(new Error(`Not a valid UUID: ${newUuid}`));
}

// Test Collision
Expand Down
1 change: 0 additions & 1 deletion ngx-tools/testing/src/utilities/event-objects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ describe(`event-objects`, function() {
const actual: KeyboardEvent = createKeyboardEvent('keydown', KEYS.ENTER, target);
expect(actual.code).toEqual(KEYS.ENTER.code);
expect(actual.key).toEqual(KEYS.ENTER.code);
expect(actual.keyCode).toEqual(KEYS.ENTER.keyCode);
expect(actual.target).toEqual(target);
});

Expand Down
1 change: 0 additions & 1 deletion ngx-tools/testing/src/utilities/event-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export function createKeyboardEvent(
// Webkit Browsers don't set the keyCode when calling the init function.
// See related bug https://bugs.webkit.org/show_bug.cgi?id=16735
Object.defineProperties(event, {
keyCode: {get: () => key.keyCode},
key: {get: () => key.code},
target: {get: () => target},
code: {get: () => key.code},
Expand Down

0 comments on commit 705e5bf

Please sign in to comment.