Skip to content

Commit

Permalink
Better toObject() test
Browse files Browse the repository at this point in the history
  • Loading branch information
afshin committed Aug 16, 2022
1 parent 1442576 commit da91b28
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/algorithm/tests/src/iter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
|----------------------------------------------------------------------------*/
import { expect } from 'chai';

import { each, every, some, toArray, toObject } from '@lumino/algorithm';
import { each, every, some, toArray, toObject, zip } from '@lumino/algorithm';

/**
* A helper function to test the methods of an iterator.
Expand Down Expand Up @@ -40,12 +40,10 @@ describe('@lumino/algorithm', () => {

describe('toObject()', () => {
it('should create an object from a [key, value] iterable', () => {
let data: [string, number][] = [
['one', 1],
['two', 2],
['three', 3]
];
let result = toObject(data);
let keys = ['one', 'two', 'three'];
let values = [1, 2, 3];
let stream = zip<string | number>(keys, values);
let result = toObject(stream as Iterable<[string, number]>);
expect(result).to.deep.equal({ one: 1, two: 2, three: 3 });
});
});
Expand Down

0 comments on commit da91b28

Please sign in to comment.