Skip to content

Commit

Permalink
fix: update mocha types
Browse files Browse the repository at this point in the history
  • Loading branch information
calebboyd committed Feb 23, 2021
1 parent 3c259e5 commit a03b39b
Show file tree
Hide file tree
Showing 52 changed files with 139 additions and 139 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"@angular-devkit/schematics": "^11.0.7",
"@types/chai": "^4.2.11",
"@types/lodash": "4.14.102",
"@types/mocha": "^7.0.2",
"@types/mocha": "^8.2.1",
"@types/node": "^14.14.6",
"@types/shelljs": "^0.8.8",
"@types/sinon": "4.1.3",
Expand Down
4 changes: 2 additions & 2 deletions spec/Scheduler-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Scheduler.queue', () => {
expect(call2).to.be.true;
});

it('should schedule things in the future too', (done: MochaDone) => {
it('should schedule things in the future too', (done: Mocha.Done) => {
let called = false;
queue.schedule(() => {
called = true;
Expand All @@ -49,7 +49,7 @@ describe('Scheduler.queue', () => {
}, 100);
});

it('should be reusable after an error is thrown during execution', (done: MochaDone) => {
it('should be reusable after an error is thrown during execution', (done: Mocha.Done) => {
const results: number[] = [];

expect(() => {
Expand Down
16 changes: 8 additions & 8 deletions spec/Subject-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('Subject', () => {
rxTestScheduler = new TestScheduler(observableMatcher);
});

it('should allow next with undefined or any when created with no type', (done: MochaDone) => {
it('should allow next with undefined or any when created with no type', (done: Mocha.Done) => {
const subject = new Subject();
subject.subscribe(
(x) => {
Expand All @@ -29,7 +29,7 @@ describe('Subject', () => {
subject.complete();
});

it('should allow empty next when created with void type', (done: MochaDone) => {
it('should allow empty next when created with void type', (done: Mocha.Done) => {
const subject = new Subject<void>();
subject.subscribe(
(x) => {
Expand All @@ -43,7 +43,7 @@ describe('Subject', () => {
subject.complete();
});

it('should pump values right on through itself', (done: MochaDone) => {
it('should pump values right on through itself', (done: Mocha.Done) => {
const subject = new Subject<string>();
const expected = ['foo', 'bar'];

Expand All @@ -60,7 +60,7 @@ describe('Subject', () => {
subject.complete();
});

it('should pump values to multiple subscribers', (done: MochaDone) => {
it('should pump values to multiple subscribers', (done: Mocha.Done) => {
const subject = new Subject<string>();
const expected = ['foo', 'bar'];

Expand Down Expand Up @@ -397,7 +397,7 @@ describe('Subject', () => {
expect(results3).to.deep.equal([]);
});

it('should not allow values to be nexted after it is unsubscribed', (done: MochaDone) => {
it('should not allow values to be nexted after it is unsubscribed', (done: Mocha.Done) => {
const subject = new Subject<string>();
const expected = ['foo'];

Expand All @@ -411,7 +411,7 @@ describe('Subject', () => {
done();
});

it('should clean out unsubscribed subscribers', (done: MochaDone) => {
it('should clean out unsubscribed subscribers', (done: Mocha.Done) => {
const subject = new Subject();

const sub1 = subject.subscribe(function (x) {
Expand Down Expand Up @@ -530,7 +530,7 @@ describe('Subject', () => {
expect(outputComplete).to.be.true;
});

it('should be an Observer which can be given to Observable.subscribe', (done: MochaDone) => {
it('should be an Observer which can be given to Observable.subscribe', (done: Mocha.Done) => {
const source = of(1, 2, 3, 4, 5);
const subject = new Subject<number>();
const expected = [1, 2, 3, 4, 5];
Expand All @@ -550,7 +550,7 @@ describe('Subject', () => {
source.subscribe(subject);
});

it('should be usable as an Observer of a finite delayed Observable', (done: MochaDone) => {
it('should be usable as an Observer of a finite delayed Observable', (done: Mocha.Done) => {
const source = of(1, 2, 3).pipe(delay(50));
const subject = new Subject<number>();

Expand Down
2 changes: 1 addition & 1 deletion spec/observables/bindCallback-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('bindCallback', () => {
expect(results).to.deep.equal([5, 'done']);
});

it('should not emit, throw or complete if immediately unsubscribed', (done: MochaDone) => {
it('should not emit, throw or complete if immediately unsubscribed', (done: Mocha.Done) => {
const nextSpy = sinon.spy();
const throwSpy = sinon.spy();
const completeSpy = sinon.spy();
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/bindNodeCallback-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('bindNodeCallback', () => {
expect(results).to.deep.equal([error]);
});

it('should not emit, throw or complete if immediately unsubscribed', (done: MochaDone) => {
it('should not emit, throw or complete if immediately unsubscribed', (done: Mocha.Done) => {
const nextSpy = sinon.spy();
const throwSpy = sinon.spy();
const completeSpy = sinon.spy();
Expand Down
4 changes: 2 additions & 2 deletions spec/observables/defer-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('defer', () => {
});
});

it('should accept factory returns promise resolves', (done: MochaDone) => {
it('should accept factory returns promise resolves', (done: Mocha.Done) => {
const expected = 42;
const e1 = defer(() => {
return new Promise<number>((resolve: any) => {
Expand All @@ -66,7 +66,7 @@ describe('defer', () => {
);
});

it('should accept factory returns promise rejects', (done: MochaDone) => {
it('should accept factory returns promise rejects', (done: Mocha.Done) => {
const expected = 42;
const e1 = defer(() => {
return new Promise<number>((resolve: any, reject: any) => {
Expand Down
4 changes: 2 additions & 2 deletions spec/observables/dom/ajax-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ describe('ajax', () => {
expect(error).to.be.an('error', 'wokka wokka');
});

it('should error if send request throws', (done: MochaDone) => {
it('should error if send request throws', (done: Mocha.Done) => {
const expected = new Error('xhr send failure');

ajax({
Expand Down Expand Up @@ -653,7 +653,7 @@ describe('ajax', () => {
expect(MockXMLHttpRequest.mostRecent.data).to.equal('{"hello":"world"}');
});

it('should error if send request throws', (done: MochaDone) => {
it('should error if send request throws', (done: Mocha.Done) => {
const expected = new Error('xhr send failure');

const obj: AjaxConfig = {
Expand Down
14 changes: 7 additions & 7 deletions spec/observables/fromEvent-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ describe('fromEvent', () => {
expect(offOptions).to.equal(expectedOptions);
});

it('should pass through events that occur', (done: MochaDone) => {
it('should pass through events that occur', (done: Mocha.Done) => {
let send: any;
const obj = {
on: (name: string, handler: Function) => {
Expand All @@ -245,7 +245,7 @@ describe('fromEvent', () => {
send('test');
});

it('should pass through events that occur and use the selector if provided', (done: MochaDone) => {
it('should pass through events that occur and use the selector if provided', (done: Mocha.Done) => {
let send: any;
const obj = {
on: (name: string, handler: Function) => {
Expand All @@ -272,7 +272,7 @@ describe('fromEvent', () => {
send('test');
});

it('should not fail if no event arguments are passed and the selector does not return', (done: MochaDone) => {
it('should not fail if no event arguments are passed and the selector does not return', (done: Mocha.Done) => {
let send: any;
const obj = {
on: (name: string, handler: Function) => {
Expand All @@ -299,7 +299,7 @@ describe('fromEvent', () => {
send();
});

it('should return a value from the selector if no event arguments are passed', (done: MochaDone) => {
it('should return a value from the selector if no event arguments are passed', (done: Mocha.Done) => {
let send: any;
const obj = {
on: (name: string, handler: Function) => {
Expand All @@ -326,7 +326,7 @@ describe('fromEvent', () => {
send();
});

it('should pass multiple arguments to selector from event emitter', (done: MochaDone) => {
it('should pass multiple arguments to selector from event emitter', (done: Mocha.Done) => {
let send: any;
const obj = {
on: (name: string, handler: Function) => {
Expand All @@ -353,7 +353,7 @@ describe('fromEvent', () => {
send(1, 2, 3);
});

it('should emit multiple arguments from event as an array', (done: MochaDone) => {
it('should emit multiple arguments from event as an array', (done: Mocha.Done) => {
let send: any;
const obj = {
on: (name: string, handler: Function) => {
Expand All @@ -376,7 +376,7 @@ describe('fromEvent', () => {
send(1, 2, 3);
});

it('should not throw an exception calling toString on obj with a null prototype', (done: MochaDone) => {
it('should not throw an exception calling toString on obj with a null prototype', (done: Mocha.Done) => {
// NOTE: Can not test with Object.create(null) or `class Foo extends null`
// due to TypeScript bug. https://github.com/Microsoft/TypeScript/issues/1108
class NullProtoEventTarget {
Expand Down
6 changes: 3 additions & 3 deletions spec/observables/fromEventPattern-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('fromEventPattern', () => {
expect(call).calledWith(sinon.match.any, expected);
});

it('should send errors in addHandler down the error path', (done: MochaDone) => {
it('should send errors in addHandler down the error path', (done: Mocha.Done) => {
fromEventPattern((h: any) => {
throw 'bad';
}, noop).subscribe(
Expand All @@ -70,7 +70,7 @@ describe('fromEventPattern', () => {
}, () => done(new Error('should not be called')));
});

it('should accept a selector that maps outgoing values', (done: MochaDone) => {
it('should accept a selector that maps outgoing values', (done: Mocha.Done) => {
let target: any;
const trigger = function (...args: any[]) {
if (target) {
Expand Down Expand Up @@ -100,7 +100,7 @@ describe('fromEventPattern', () => {
trigger('test', 'me');
});

it('should send errors in the selector down the error path', (done: MochaDone) => {
it('should send errors in the selector down the error path', (done: Mocha.Done) => {
let target: any;
const trigger = (value: any) => {
if (target) {
Expand Down
8 changes: 4 additions & 4 deletions spec/observables/if-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('iif', () => {
expectObservable(e1).toBe(expected);
});

it('should accept resolved promise as thenSource', (done: MochaDone) => {
it('should accept resolved promise as thenSource', (done: Mocha.Done) => {
const expected = 42;
const e1 = iif(() => true, new Promise((resolve: any) => { resolve(expected); }), of());

Expand All @@ -47,7 +47,7 @@ describe('iif', () => {
});
});

it('should accept resolved promise as elseSource', (done: MochaDone) => {
it('should accept resolved promise as elseSource', (done: Mocha.Done) => {
const expected = 42;
const e1 = iif(() => false,
of('a'),
Expand All @@ -62,7 +62,7 @@ describe('iif', () => {
});
});

it('should accept rejected promise as elseSource', (done: MochaDone) => {
it('should accept rejected promise as elseSource', (done: Mocha.Done) => {
const expected = 42;
const e1 = iif(() => false,
of('a'),
Expand All @@ -78,7 +78,7 @@ describe('iif', () => {
});
});

it('should accept rejected promise as thenSource', (done: MochaDone) => {
it('should accept rejected promise as thenSource', (done: Mocha.Done) => {
const expected = 42;
const e1 = iif(() => true, new Promise((resolve: any, reject: any) => { reject(expected); }), of());

Expand Down
8 changes: 4 additions & 4 deletions spec/observables/interval-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('interval', () => {
expectObservable(e1).toBe(expected, [0, 1, 2, 3, 4, 5, 6]);
});

it('should emit values until unsubscribed', (done: MochaDone) => {
it('should emit values until unsubscribed', (done: Mocha.Done) => {
const values: number[] = [];
const expected = [0, 1, 2, 3, 4, 5, 6];
const e1 = interval(5);
Expand All @@ -61,7 +61,7 @@ describe('interval', () => {
});
});

it('should create an observable emitting periodically with the AsapScheduler', (done: MochaDone) => {
it('should create an observable emitting periodically with the AsapScheduler', (done: Mocha.Done) => {
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();
const period = 10;
Expand All @@ -88,7 +88,7 @@ describe('interval', () => {
}
});

it('should create an observable emitting periodically with the QueueScheduler', (done: MochaDone) => {
it('should create an observable emitting periodically with the QueueScheduler', (done: Mocha.Done) => {
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();
const period = 10;
Expand All @@ -115,7 +115,7 @@ describe('interval', () => {
}
});

it('should create an observable emitting periodically with the AnimationFrameScheduler', (done: MochaDone) => {
it('should create an observable emitting periodically with the AnimationFrameScheduler', (done: Mocha.Done) => {
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();
const period = 10;
Expand Down
4 changes: 2 additions & 2 deletions spec/observables/of-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('of', () => {
expectObservable(e1).toBe(expected, {x: 1, y: 2, z: 3});
});

it('should create an observable from the provided values', (done: MochaDone) => {
it('should create an observable from the provided values', (done: Mocha.Done) => {
const x = { foo: 'bar' };
const expected = [1, 'a', x];
let i = 0;
Expand All @@ -32,7 +32,7 @@ describe('of', () => {
});
});

it('should emit one value', (done: MochaDone) => {
it('should emit one value', (done: Mocha.Done) => {
let calls = 0;

of(42).subscribe((x: number) => {
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/pairs-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('pairs', () => {
expectObservable(e1).toBe(expected, values);
});

it('should create an observable without scheduler', (done: MochaDone) => {
it('should create an observable without scheduler', (done: Mocha.Done) => {
let expected = [
['a', 1],
['b', 2],
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/race-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ describe('static race', () => {
expectSubscriptions(e1.subscriptions).toBe(e1subs);
});

it('should support a single ObservableInput argument', (done: MochaDone) => {
it('should support a single ObservableInput argument', (done: Mocha.Done) => {
const source = race(Promise.resolve(42));
source.subscribe(value => {
expect(value).to.equal(42);
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/range-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('range', () => {
expect(results).to.deep.equal([12, 13, 14, 15]);
});

it('should accept a scheduler', (done: MochaDone) => {
it('should accept a scheduler', (done: Mocha.Done) => {
const expected = [12, 13, 14, 15];
sinon.spy(asap, 'schedule');

Expand Down
Loading

0 comments on commit a03b39b

Please sign in to comment.