Skip to content

Commit

Permalink
chore(test): fix groupBy types
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed May 21, 2018
1 parent b96409c commit bef4196
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions spec/operators/groupBy-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ describe('Observable.prototype.groupBy', () => {
expectObservable(source).toBe(expected, expectedValues);
});

function reverseString(str) {
function reverseString(str: string) {
return str.split('').reverse().join('');
}

function mapObject(obj, fn) {
function mapObject(obj: object, fn: Function) {
const out = {};
for (const p in obj) {
if (obj.hasOwnProperty(p)) {
Expand Down Expand Up @@ -81,15 +81,15 @@ describe('Observable.prototype.groupBy', () => {
{ key: 0, values: [6] }
];

const resultingGroups = [];
const resultingGroups: { key: number, values: number [] }[] = [];

Observable.of(1, 2, 3, 4, 5, 6)
.groupBy(
(x: number) => x % 2,
(x: number) => x,
(g: any) => g.skip(1))
.subscribe((g: any) => {
let group = { key: g.key, values: [] };
let group = { key: g.key, values: [] as number[] };

g.subscribe((x: any) => {
group.values.push(x);
Expand Down Expand Up @@ -544,7 +544,7 @@ describe('Observable.prototype.groupBy', () => {
const source = e1
.groupBy((val: string) => val.toLowerCase().trim())
.map((group: any) => {
const arr = [];
const arr: any[] = [];

const subscription = group
.materialize()
Expand Down Expand Up @@ -608,7 +608,7 @@ describe('Observable.prototype.groupBy', () => {
const source = e1
.groupBy((val: string) => val.toLowerCase().trim())
.map((group: any) => {
const arr = [];
const arr: any[] = [];

const subscription = group
.materialize()
Expand Down Expand Up @@ -879,7 +879,7 @@ describe('Observable.prototype.groupBy', () => {
(group: any) => group.skip(2)
)
.map((group: any) => {
const arr = [];
const arr: any[] = [];

const subscription = group
.materialize()
Expand Down Expand Up @@ -1106,7 +1106,7 @@ describe('Observable.prototype.groupBy', () => {
(group: any) => group.skip(2)
)
.map((group: any, index: number) => {
const arr = [];
const arr: any[] = [];

const subscription = group
.materialize()
Expand Down Expand Up @@ -1183,7 +1183,7 @@ describe('Observable.prototype.groupBy', () => {
(group: any) => group.skip(2)
)
.map((group: any) => {
const arr = [];
const arr: any[] = [];

const subscription = group
.materialize()
Expand Down Expand Up @@ -1254,7 +1254,7 @@ describe('Observable.prototype.groupBy', () => {
(val: string) => val.toLowerCase().trim(),
(val: string) => val
).map((group: any) => {
const innerNotifications = [];
const innerNotifications: any[] = [];
const subscriptionFrame = subscriptionFrames[group.key];

rxTestScheduler.schedule(() => {
Expand Down Expand Up @@ -1304,7 +1304,7 @@ describe('Observable.prototype.groupBy', () => {
(group: any) => group.skip(7)
)
.map((group: any) => {
const arr = [];
const arr: any[] = [];

rxTestScheduler.schedule(() => {
group
Expand Down Expand Up @@ -1353,7 +1353,7 @@ describe('Observable.prototype.groupBy', () => {
(group: any) => group.skip(7)
)
.map((group: any) => {
const arr = [];
const arr: any[] = [];

rxTestScheduler.schedule(() => {
group
Expand Down Expand Up @@ -1404,7 +1404,7 @@ describe('Observable.prototype.groupBy', () => {
(group: any) => group.skip(7)
)
.map((group: any) => {
const arr = [];
const arr: any[] = [];

rxTestScheduler.schedule(() => {
group
Expand Down

0 comments on commit bef4196

Please sign in to comment.