Skip to content

Commit a4b448d

Browse files
committed
Remove "sections" and refactor tests
1 parent 957c59a commit a4b448d

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

lib/node_modules/@stdlib/iter/any/docs/types/index.d.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ interface IteratorResult {
3939
done: boolean;
4040
}
4141

42-
43-
// MAIN //
44-
4542
/**
4643
* Tests whether at least one iterated value is truthy.
4744
*

lib/node_modules/@stdlib/iter/any/docs/types/test.ts

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818

1919
import iterAny = require( './index' );
2020

21-
22-
// FUNCTIONS //
23-
2421
/**
2522
* Returns an iterator protocol-compliant object.
2623
*
@@ -47,8 +44,25 @@ function iterator() {
4744

4845
// TESTS //
4946

50-
iterAny( iterator() ); // $ExpectType boolean
51-
iterAny( null ); // $ExpectError
52-
iterAny( [] ); // $ExpectError
53-
iterAny( {} ); // $ExpectError
54-
iterAny(); // $ExpectError
47+
// The function returns a boolean...
48+
{
49+
iterAny( iterator() ); // $ExpectType boolean
50+
}
51+
52+
// The function does not compile if provided a value other than an iterator protocol-compliant object...
53+
{
54+
iterAny( '5' ); // $ExpectError
55+
iterAny( 5 ); // $ExpectError
56+
iterAny( true ); // $ExpectError
57+
iterAny( false ); // $ExpectError
58+
iterAny( null ); // $ExpectError
59+
iterAny( undefined ); // $ExpectError
60+
iterAny( [] ); // $ExpectError
61+
iterAny( {} ); // $ExpectError
62+
iterAny( ( x ) => x ); // $ExpectError
63+
}
64+
65+
// The function does not compile if provided insufficient arguments...
66+
{
67+
iterAny(); // $ExpectError
68+
}

0 commit comments

Comments
 (0)