Skip to content

Commit

Permalink
style(linting): enable tsc's 'noUnusedParameters' option for spec/.
Browse files Browse the repository at this point in the history
  • Loading branch information
tetsuharuohzeki committed Oct 12, 2016
1 parent eed6caa commit ec36e3d
Show file tree
Hide file tree
Showing 83 changed files with 365 additions and 364 deletions.
40 changes: 20 additions & 20 deletions spec/Notification-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ describe('Notification', () => {
it('should invoke on next', () => {
const n = Notification.createNext('a');
let invoked = false;
n.do((x: string) => {
n.do((_: string) => {
invoked = true;
}, (err: any) => {
}, (_: any) => {
throw 'should not be called';
}, () => {
throw 'should not be called';
Expand All @@ -116,9 +116,9 @@ describe('Notification', () => {
it('should invoke on error', () => {
const n = Notification.createError();
let invoked = false;
n.do((x: any) => {
n.do((_: any) => {
throw 'should not be called';
}, (err: any) => {
}, (_: any) => {
invoked = true;
}, () => {
throw 'should not be called';
Expand All @@ -130,9 +130,9 @@ describe('Notification', () => {
it('should invoke on complete', () => {
const n = Notification.createComplete();
let invoked = false;
n.do((x: any) => {
n.do((_: any) => {
throw 'should not be called';
}, (err: any) => {
}, (_: any) => {
throw 'should not be called';
}, () => {
invoked = true;
Expand All @@ -150,7 +150,7 @@ describe('Notification', () => {
const observer = Rx.Subscriber.create((x: string) => {
expect(x).to.equal(value);
observed = true;
}, (err: any) => {
}, (_: any) => {
throw 'should not be called';
}, () => {
throw 'should not be called';
Expand All @@ -163,9 +163,9 @@ describe('Notification', () => {
it('should accept observer for error Notification', () => {
let observed = false;
const n = Notification.createError();
const observer = Rx.Subscriber.create((x: string) => {
const observer = Rx.Subscriber.create((_: string) => {
throw 'should not be called';
}, (err: any) => {
}, (_: any) => {
observed = true;
}, () => {
throw 'should not be called';
Expand All @@ -178,9 +178,9 @@ describe('Notification', () => {
it('should accept observer for complete Notification', () => {
let observed = false;
const n = Notification.createComplete();
const observer = Rx.Subscriber.create((x: string) => {
const observer = Rx.Subscriber.create((_: string) => {
throw 'should not be called';
}, (err: any) => {
}, (_: any) => {
throw 'should not be called';
}, () => {
observed = true;
Expand All @@ -198,7 +198,7 @@ describe('Notification', () => {
n.accept((x: string) => {
expect(x).to.equal(value);
observed = true;
}, (err: any) => {
}, (_: any) => {
throw 'should not be called';
}, () => {
throw 'should not be called';
Expand All @@ -211,7 +211,7 @@ describe('Notification', () => {
const error = 'error';
const n = Notification.createError(error);

n.accept((x: any) => {
n.accept((_: any) => {
throw 'should not be called';
}, (err: any) => {
expect(err).to.equal(error);
Expand All @@ -226,9 +226,9 @@ describe('Notification', () => {
let observed = false;
const n = Notification.createComplete();

n.accept((x: any) => {
n.accept((_: any) => {
throw 'should not be called';
}, (err: any) => {
}, (_: any) => {
throw 'should not be called';
}, () => {
observed = true;
Expand All @@ -245,7 +245,7 @@ describe('Notification', () => {
const observer = Rx.Subscriber.create((x: string) => {
expect(x).to.equal(value);
observed = true;
}, (err: any) => {
}, (_: any) => {
throw 'should not be called';
}, () => {
throw 'should not be called';
Expand All @@ -258,9 +258,9 @@ describe('Notification', () => {
it('should observe for error Notification', () => {
let observed = false;
const n = Notification.createError();
const observer = Rx.Subscriber.create((x: any) => {
const observer = Rx.Subscriber.create((_: any) => {
throw 'should not be called';
}, (err: any) => {
}, (_: any) => {
observed = true;
}, () => {
throw 'should not be called';
Expand All @@ -273,9 +273,9 @@ describe('Notification', () => {
it('should observe for complete Notification', () => {
let observed = false;
const n = Notification.createComplete();
const observer = Rx.Subscriber.create((x: any) => {
const observer = Rx.Subscriber.create((_: any) => {
throw 'should not be called';
}, (err: any) => {
}, (_: any) => {
throw 'should not be called';
}, () => {
observed = true;
Expand Down
10 changes: 5 additions & 5 deletions spec/Observable-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Observable', () => {
});

it('should reject promise when in error', (done: MochaDone) => {
Observable.throw('bad').forEach((x: any) => {
Observable.throw('bad').forEach((_: any) => {
done(new Error('should not be called'));
}, Promise).then(() => {
done(new Error('should not complete'));
Expand Down Expand Up @@ -609,7 +609,7 @@ describe('Observable.lift', () => {
result.subscribe(
function (x) {
expect(x).to.equal(expected.shift());
}, (x) => {
}, (_) => {
done(new Error('should not be called'));
}, () => {
done();
Expand All @@ -634,7 +634,7 @@ describe('Observable.lift', () => {
result.subscribe(
function (x) {
expect(x).to.equal(expected.shift());
}, (x) => {
}, (_) => {
done(new Error('should not be called'));
}, () => {
done();
Expand All @@ -657,7 +657,7 @@ describe('Observable.lift', () => {
result.subscribe(
function (x) {
expect(x).to.equal(expected.shift());
}, (x) => {
}, (_) => {
done(new Error('should not be called'));
}, () => {
done();
Expand Down Expand Up @@ -785,7 +785,7 @@ describe('Observable.lift', () => {
function (x) {
expect(x).to.equal(expected.shift());
},
(x) => {
(_) => {
done(new Error('should not be called'));
}, () => {
expect(log).to.deep.equal([
Expand Down
38 changes: 19 additions & 19 deletions spec/Subject-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ describe('Subject', () => {

const subscription1 = subject.subscribe(
function (x) { results1.push(x); },
function (e) { results1.push('E'); },
function (_) { results1.push('E'); },
() => { results1.push('C'); }
);

subject.next(5);

const subscription2 = subject.subscribe(
function (x) { results2.push(x); },
function (e) { results2.push('E'); },
function (_) { results2.push('E'); },
() => { results2.push('C'); }
);

Expand All @@ -82,7 +82,7 @@ describe('Subject', () => {

const subscription3 = subject.subscribe(
function (x) { results3.push(x); },
function (e) { results3.push('E'); },
function (_) { results3.push('E'); },
() => { results3.push('C'); }
);

Expand All @@ -109,15 +109,15 @@ describe('Subject', () => {

const subscription1 = subject.subscribe(
function (x) { results1.push(x); },
function (e) { results1.push('E'); },
function (_) { results1.push('E'); },
() => { results1.push('C'); }
);

subject.next(5);

const subscription2 = subject.subscribe(
function (x) { results2.push(x); },
function (e) { results2.push('E'); },
function (_) { results2.push('E'); },
() => { results2.push('C'); }
);

Expand All @@ -132,7 +132,7 @@ describe('Subject', () => {

const subscription3 = subject.subscribe(
function (x) { results3.push(x); },
function (e) { results3.push('E'); },
function (_) { results3.push('E'); },
() => { results3.push('C'); }
);

Expand All @@ -157,15 +157,15 @@ describe('Subject', () => {

const subscription1 = subject.subscribe(
function (x) { results1.push(x); },
function (e) { results1.push('E'); },
function (_) { results1.push('E'); },
() => { results1.push('C'); }
);

subject.next(5);

const subscription2 = subject.subscribe(
function (x) { results2.push(x); },
function (e) { results2.push('E'); },
function (_) { results2.push('E'); },
() => { results2.push('C'); }
);

Expand All @@ -180,7 +180,7 @@ describe('Subject', () => {

const subscription3 = subject.subscribe(
function (x) { results3.push(x); },
function (e) { results3.push('E'); },
function (_) { results3.push('E'); },
() => { results3.push('C'); }
);

Expand All @@ -200,13 +200,13 @@ describe('Subject', () => {

const subscription1 = subject.subscribe(
function (x) { results1.push(x); },
function (e) { results1.push('E'); },
function (_) { results1.push('E'); },
() => { results1.push('C'); }
);

const subscription2 = subject.subscribe(
function (x) { results2.push(x); },
function (e) { results2.push('E'); },
function (_) { results2.push('E'); },
() => { results2.push('C'); }
);

Expand All @@ -218,7 +218,7 @@ describe('Subject', () => {

const subscription3 = subject.subscribe(
function (x) { results3.push(x); },
function (e) { results3.push('E'); },
function (_) { results3.push('E'); },
() => { results3.push('C'); }
);

Expand All @@ -237,7 +237,7 @@ describe('Subject', () => {

const subscription1 = subject.subscribe(
function (x) { results1.push(x); },
function (e) { results1.push('E'); },
function (_) { results1.push('E'); },
() => { results1.push('C'); }
);

Expand All @@ -246,7 +246,7 @@ describe('Subject', () => {

const subscription2 = subject.subscribe(
function (x) { results2.push(x); },
function (e) { results2.push('E'); },
function (_) { results2.push('E'); },
() => { results2.push('C'); }
);

Expand All @@ -261,7 +261,7 @@ describe('Subject', () => {
expect(() => {
subject.subscribe(
function (x) { results3.push(x); },
function (e) { results3.push('E'); },
function (_) { results3.push('E'); },
() => { results3.push('C'); }
);
}).to.throw();
Expand All @@ -288,11 +288,11 @@ describe('Subject', () => {
it('should clean out unsubscribed subscribers', (done: MochaDone) => {
const subject = new Subject();

const sub1 = subject.subscribe(function (x) {
const sub1 = subject.subscribe(function (_) {
//noop
});

const sub2 = subject.subscribe(function (x) {
const sub2 = subject.subscribe(function (_) {
//noop
});

Expand Down Expand Up @@ -404,7 +404,7 @@ describe('Subject', () => {
subject.subscribe(
function (x) {
expect(x).to.equal(expected.shift());
}, (x) => {
}, (_) => {
done(new Error('should not be called'));
}, () => {
done();
Expand All @@ -422,7 +422,7 @@ describe('Subject', () => {
subject.subscribe(
function (x) {
expect(x).to.equal(expected.shift());
}, (x) => {
}, (_) => {
done(new Error('should not be called'));
}, () => {
done();
Expand Down
12 changes: 6 additions & 6 deletions spec/Subscription-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ describe('Subscription', () => {
it('should not leak', (done: MochaDone) => {
const tearDowns = [];

const source1 = Observable.create((observer: Rx.Observer<any>) => {
const source1 = Observable.create((_: Rx.Observer<any>) => {
return () => {
tearDowns.push(1);
};
});

const source2 = Observable.create((observer: Rx.Observer<any>) => {
const source2 = Observable.create((_: Rx.Observer<any>) => {
return () => {
tearDowns.push(2);
throw new Error('oops, I am a bad unsubscribe!');
};
});

const source3 = Observable.create((observer: Rx.Observer<any>) => {
const source3 = Observable.create((_: Rx.Observer<any>) => {
return () => {
tearDowns.push(3);
};
Expand All @@ -44,13 +44,13 @@ describe('Subscription', () => {

const sub = new Subscription();

const source1 = Observable.create((observer: Rx.Observer<any>) => {
const source1 = Observable.create((_: Rx.Observer<any>) => {
return () => {
tearDowns.push(1);
};
});

const source2 = Observable.create((observer: Rx.Observer<any>) => {
const source2 = Observable.create((_: Rx.Observer<any>) => {
return () => {
tearDowns.push(2);
sub.add(<any>({
Expand All @@ -62,7 +62,7 @@ describe('Subscription', () => {
};
});

const source3 = Observable.create((observer: Rx.Observer<any>) => {
const source3 = Observable.create((_: Rx.Observer<any>) => {
return () => {
tearDowns.push(3);
};
Expand Down
Loading

0 comments on commit ec36e3d

Please sign in to comment.