Skip to content

Commit 4805a7f

Browse files
authored
Zip legacy formatting (#6137)
* 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
1 parent b509262 commit 4805a7f

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

spec/operators/zip-legacy-spec.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @prettier */
12
import { expect } from 'chai';
23
import { zip } from 'rxjs/operators';
34
import { from } from 'rxjs';
@@ -14,19 +15,18 @@ describe('zip legacy', () => {
1415
rxTestScheduler = new TestScheduler(observableMatcher);
1516
});
1617

17-
it('should zip the provided observables', done => {
18+
it('should zip the provided observables', (done) => {
1819
const expected = ['a1', 'b2', 'c3'];
1920
let i = 0;
2021

2122
from(['a', 'b', 'c'])
2223
.pipe(zip(from([1, 2, 3]), (a, b): string => a + b))
23-
.subscribe(
24-
function(x) {
24+
.subscribe({
25+
next(x) {
2526
expect(x).to.equal(expected[i++]);
2627
},
27-
null,
28-
done
29-
);
28+
complete: done,
29+
});
3030
});
3131

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

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

6262
expectObservable(
6363
a.pipe(
64-
zip(b, function(r1, r2) {
64+
zip(b, (r1, r2) => {
6565
return r1 + r2;
6666
})
6767
)
@@ -81,7 +81,7 @@ describe('zip legacy', () => {
8181

8282
expectObservable(
8383
a.pipe(
84-
zip(b, function(r1, r2) {
84+
zip(b, (r1, r2) => {
8585
return r1 + r2;
8686
})
8787
)
@@ -101,7 +101,7 @@ describe('zip legacy', () => {
101101

102102
expectObservable(
103103
a.pipe(
104-
zip(b, function(r1, r2) {
104+
zip(b, (r1, r2) => {
105105
return r1 + r2;
106106
})
107107
)
@@ -121,7 +121,7 @@ describe('zip legacy', () => {
121121
const expected = ' ----x---y-| ';
122122

123123
const observable = a.pipe(
124-
zip(b, c, function(r0, r1, r2) {
124+
zip(b, c, (r0, r1, r2) => {
125125
return [r0, r1, r2];
126126
})
127127
);
@@ -141,7 +141,7 @@ describe('zip legacy', () => {
141141
const expected = ' ----x---y-| ';
142142

143143
const observable = a.pipe(
144-
zip(b, c, function(r0, r1, r2) {
144+
zip(b, c, (r0, r1, r2) => {
145145
return [r0, r1, r2];
146146
})
147147
);
@@ -161,7 +161,7 @@ describe('zip legacy', () => {
161161

162162
expectObservable(
163163
a.pipe(
164-
zip(b, function(e1, e2) {
164+
zip(b, (e1, e2) => {
165165
return e1 + e2;
166166
})
167167
)

0 commit comments

Comments
 (0)