Skip to content

Commit

Permalink
Zip legacy formatting (#6137)
Browse files Browse the repository at this point in the history
* chore(zip): update code formatting of legacy zip tests

* chore(zip): replace deprecated apis in legacy zip tests

* chore(zip): replace functions with arrow functions
  • Loading branch information
tmair authored Mar 14, 2021
1 parent b509262 commit 4805a7f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions spec/operators/zip-legacy-spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @prettier */
import { expect } from 'chai';
import { zip } from 'rxjs/operators';
import { from } from 'rxjs';
Expand All @@ -14,19 +15,18 @@ describe('zip legacy', () => {
rxTestScheduler = new TestScheduler(observableMatcher);
});

it('should zip the provided observables', done => {
it('should zip the provided observables', (done) => {
const expected = ['a1', 'b2', 'c3'];
let i = 0;

from(['a', 'b', 'c'])
.pipe(zip(from([1, 2, 3]), (a, b): string => a + b))
.subscribe(
function(x) {
.subscribe({
next(x) {
expect(x).to.equal(expected[i++]);
},
null,
done
);
complete: done,
});
});

it('should work with selector throws', () => {
Expand All @@ -37,7 +37,7 @@ describe('zip legacy', () => {
const bsubs = ' ^-------! ';
const expected = ' ---x----# ';

const selector = function(x: string, y: string) {
const selector = (x: string, y: string) => {
if (y === '5') {
throw new Error('too bad');
} else {
Expand All @@ -61,7 +61,7 @@ describe('zip legacy', () => {

expectObservable(
a.pipe(
zip(b, function(r1, r2) {
zip(b, (r1, r2) => {
return r1 + r2;
})
)
Expand All @@ -81,7 +81,7 @@ describe('zip legacy', () => {

expectObservable(
a.pipe(
zip(b, function(r1, r2) {
zip(b, (r1, r2) => {
return r1 + r2;
})
)
Expand All @@ -101,7 +101,7 @@ describe('zip legacy', () => {

expectObservable(
a.pipe(
zip(b, function(r1, r2) {
zip(b, (r1, r2) => {
return r1 + r2;
})
)
Expand All @@ -121,7 +121,7 @@ describe('zip legacy', () => {
const expected = ' ----x---y-| ';

const observable = a.pipe(
zip(b, c, function(r0, r1, r2) {
zip(b, c, (r0, r1, r2) => {
return [r0, r1, r2];
})
);
Expand All @@ -141,7 +141,7 @@ describe('zip legacy', () => {
const expected = ' ----x---y-| ';

const observable = a.pipe(
zip(b, c, function(r0, r1, r2) {
zip(b, c, (r0, r1, r2) => {
return [r0, r1, r2];
})
);
Expand All @@ -161,7 +161,7 @@ describe('zip legacy', () => {

expectObservable(
a.pipe(
zip(b, function(e1, e2) {
zip(b, (e1, e2) => {
return e1 + e2;
})
)
Expand Down

0 comments on commit 4805a7f

Please sign in to comment.