message: chore(fromEventPattern): convert fromEventPattern specs to run mode
diff: +/** @prettier */
  import { expect } from 'chai';
  import * as sinon from 'sinon';
  -import { expectObservable } from '../helpers/marble-testing';
  import { fromEventPattern, noop, NEVER, timer } from 'rxjs';
  import { mapTo, take, concat } from 'rxjs/operators';
  import { TestScheduler } from 'rxjs/testing';
  -
  -declare const rxTestScheduler: TestScheduler;
  +import { observableMatcher } from '../helpers/observableMatcher';
  /** @test {fromEventPattern} */
  describe('fromEventPattern', () => {
  + let rxTestScheduler: TestScheduler;
  +
  + beforeEach(() => {
  + rxTestScheduler = new TestScheduler(observableMatcher);
  + });
  +
  it('should create an observable from the handler API', () => {
  + rxTestScheduler.run(({ time, expectObservable }) => {
  + const time1 = time('-----| ');
  + const time2 = time(' --| ');
  + const expected = ' -----x-x---';
  +
  function addHandler(h: any) {
  - timer(50, 20, rxTestScheduler).pipe(
  - mapTo('ev'),
  - take(2),
  - concat(NEVER)
  - ).subscribe(h);
  + timer(time1, time2, rxTestScheduler).pipe(mapTo('ev'), take(2), concat(NEVER)).subscribe(h);
  }
  const e1 = fromEventPattern(addHandler);
  - const expected = '-----x-x---';
  +
  expectObservable(e1).toBe(expected, { x: 'ev' });
  });
  + });
  it('should call addHandler on subscription', () => {
  const addHandler = sinon.spy();
  @@ -62,11 +69,14 @@ describe('fromEventPattern', () => {
  it('should send errors in addHandler down the error path', (done) => {
  fromEventPattern((h: any) => {
  throw 'bad';
  - }, noop).subscribe(
  - { next: () => done(new Error('should not be called')), error: (err: any) => {
  + }, noop).subscribe({
  + next: () => done(new Error('should not be called')),
  + error: (err: any) => {
  expect(err).to.equal('bad');
  done();
  - }, complete: () => done(new Error('should not be called')) });
  + },
  + complete: () => done(new Error('should not be called')),
  + });
  });
  it('should accept a selector that maps outgoing values', (done) => {
  @@ -87,14 +97,19 @@ describe('fromEventPattern', () => {
  return a + b + '!';
  };
  - fromEventPattern(addHandler, removeHandler, selector).pipe(take(1))
  - .subscribe({ next: (x: any) => {
  + fromEventPattern(addHandler, removeHandler, selector)
  + .pipe(take(1))
  + .subscribe({
  + next: (x: any) => {
  expect(x).to.equal('testme!');
  - }, error: (err: any) => {
  + },
  + error: (err: any) => {
  done(new Error('should not be called'));
  - }, complete: () => {
  + },
  + complete: () => {
  done();
  - } });
  + },
  + });
  trigger('test', 'me');
  });
  @@ -117,15 +132,18 @@ describe('fromEventPattern', () => {
  throw 'bad';
  };
  - fromEventPattern(addHandler, removeHandler, selector)
  - .subscribe({ next: (x: any) => {
  + fromEventPattern(addHandler, removeHandler, selector).subscribe({
  + next: (x: any) => {
  done(new Error('should not be called'));
  - }, error: (err: any) => {
  + },
  + error: (err: any) => {
  expect(err).to.equal('bad');
  done();
  - }, complete: () => {
  + },
  + complete: () => {
  done(new Error('should not be called'));
  - } });
  + },
  + });
  trigger('test');
  });
  