|
1 | 1 | /** |
2 | 2 | * @license Apache-2.0 |
3 | 3 | * |
4 | | -* Copyright (c) 2018 The Stdlib Authors. |
| 4 | +* Copyright (c) 2023 The Stdlib Authors. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
7 | 7 | * you may not use this file except in compliance with the License. |
|
21 | 21 | // MODULES // |
22 | 22 |
|
23 | 23 | var tape = require( 'tape' ); |
24 | | -var Int8Array = require( '@stdlib/array-int8' ); |
25 | | -var Uint8Array = require( '@stdlib/array-uint8' ); |
26 | | -var Uint8ClampedArray = require( '@stdlib/array-uint8c' ); |
27 | | -var Int16Array = require( '@stdlib/array-int16' ); |
28 | | -var Uint16Array = require( '@stdlib/array-uint16' ); |
29 | | -var Int32Array = require( '@stdlib/array-int32' ); |
30 | | -var Uint32Array = require( '@stdlib/array-uint32' ); |
31 | | -var Float32Array = require( '@stdlib/array-float32' ); |
32 | | -var Float64Array = require( '@stdlib/array-float64' ); |
33 | | -var allocUnsafe = require( '@stdlib/buffer-alloc-unsafe' ); |
34 | | -var isNumericArray = require( './../../dist' ); |
| 24 | +var main = require( './../../dist' ); |
35 | 25 |
|
36 | 26 |
|
37 | 27 | // TESTS // |
38 | 28 |
|
39 | | -tape( 'main export is a function', function test( t ) { |
| 29 | +tape( 'main export is defined', function test( t ) { |
40 | 30 | t.ok( true, __filename ); |
41 | | - t.strictEqual( typeof isNumericArray, 'function', 'main export is a function' ); |
42 | | - t.end(); |
43 | | -}); |
44 | | - |
45 | | -tape( 'the function returns `true` if provided a numeric array', function test( t ) { |
46 | | - var values; |
47 | | - var i; |
48 | | - |
49 | | - values = [ |
50 | | - new Int8Array( 10 ), |
51 | | - new Uint8Array( 10 ), |
52 | | - new Uint8ClampedArray( 10 ), |
53 | | - new Int16Array( 10 ), |
54 | | - new Uint16Array( 10 ), |
55 | | - new Int32Array( 10 ), |
56 | | - new Uint32Array( 10 ), |
57 | | - new Float32Array( 10 ), |
58 | | - new Float64Array( 10 ), |
59 | | - [ 1, 2, 3 ] |
60 | | - ]; |
61 | | - |
62 | | - for ( i = 0; i < values.length; i++ ) { |
63 | | - t.equal( isNumericArray( values[i] ), true, 'returns true when provided '+values[i] ); |
64 | | - } |
65 | | - t.end(); |
66 | | -}); |
67 | | - |
68 | | -tape( 'the function returns `false` if not provided a numeric array', function test( t ) { |
69 | | - var values; |
70 | | - var i; |
71 | | - |
72 | | - values = [ |
73 | | - '5', |
74 | | - 5, |
75 | | - NaN, |
76 | | - null, |
77 | | - void 0, |
78 | | - true, |
79 | | - [], |
80 | | - [5, null], |
81 | | - [5, '5' ], |
82 | | - {}, |
83 | | - function noop() {}, |
84 | | - allocUnsafe( 10 ) |
85 | | - ]; |
86 | | - |
87 | | - for ( i = 0; i < values.length; i++ ) { |
88 | | - t.equal( isNumericArray( values[i] ), false, 'returns false when provided '+values[i] ); |
89 | | - } |
| 31 | + t.strictEqual( main !== void 0, true, 'main export is defined' ); |
90 | 32 | t.end(); |
91 | 33 | }); |
0 commit comments