Skip to content

Commit c0ba73e

Browse files
committed
"added test.ts"
1 parent 86d0eee commit c0ba73e

File tree

1 file changed

+44
-0
lines changed
  • lib/node_modules/@stdlib/math/base/special/cosc/docs/types

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2019 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
import cosc = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The function returns a number...
25+
{
26+
cosc( 8 ); // $ExpectType number
27+
}
28+
29+
// The compiler throws an error if the function is provided a value other than a number...
30+
{
31+
cosc( true ); // $ExpectError
32+
cosc( false ); // $ExpectError
33+
cosc( null ); // $ExpectError
34+
cosc( undefined ); // $ExpectError
35+
cosc( '5' ); // $ExpectError
36+
cosc( [] ); // $ExpectError
37+
cosc( {} ); // $ExpectError
38+
cosc( ( x: number ): number => x ); // $ExpectError
39+
}
40+
41+
// The compiler throws an error if the function is provided insufficient arguments...
42+
{
43+
cosc(); // $ExpectError
44+
}

0 commit comments

Comments
 (0)