Skip to content

Commit 57a161b

Browse files
committed
Merge branch 'update/typings'
2 parents 58e3dc0 + 5f82f39 commit 57a161b

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: node_js
22
node_js:
33
- "6"
4-
- "5"
54
- "4"
65
- "0.12"
76
- "0.10"

chai-iterator.d.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,20 @@ declare module "chai/lib/Assertion" {
2626

2727
interface Assertion {
2828
iterable: Assertion;
29-
iterate: Assertion;
30-
over(values: any[]): Assertion;
31-
from(values: any[]): Assertion;
32-
until(values: any[]): Assertion;
29+
iterate: {
30+
over(values: Iterable<any>): Assertion;
31+
from(values: Iterable<any>): Assertion;
32+
until(values: Iterable<any>): Assertion;
33+
};
3334
}
3435

3536
interface Deep {
36-
iterate: Assertion;
37+
iterate: {
38+
over(values: Iterable<any>): Assertion;
39+
from(values: Iterable<any>): Assertion;
40+
until(values: Iterable<any>): Assertion;
41+
};
3742
}
38-
3943
}
4044

4145
declare function chaiIterator(chai: any, utils: any): void;

test/typescript/chai-iterator.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ chai.use(chaiIterator);
1111
// Expect/Should
1212

1313
[2, 3, 5].should.be.iterable;
14+
"abcdefg".should.be.iterable;
1415

1516
[2, 3, 5].should.iterate.over([2, 3, 5]);
17+
"abcdefg".should.iterate.over("abcdefg");
1618
[{id: 2}, {id: 3}].should.deep.iterate.over([{id: 2}, {id: 3}]);
1719

1820
[2, 3, 5].should.iterate.from([2, 3]);
21+
"abcdefg".should.iterate.from("abc");
1922
[{id: 2}, {id: 3}].should.deep.iterate.from([{id: 2}]);
2023

2124
[2, 3, 5].should.iterate.until([3, 5]);
25+
"abcdefg".should.iterate.until("efg");
2226
[{id: 2}, {id: 3}].should.deep.iterate.until([{id: 3}]);
2327

2428
// Assert

0 commit comments

Comments
 (0)