|
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. |
|
16 | 16 | * limitations under the License. |
17 | 17 | */ |
18 | 18 |
|
19 | | -/* eslint-disable object-curly-newline, no-unused-vars */ |
20 | | - |
21 | 19 | 'use strict'; |
22 | 20 |
|
23 | 21 | // MODULES // |
24 | 22 |
|
25 | 23 | var tape = require( 'tape' ); |
26 | | -var MAX_ARRAY_LENGTH = require( '@stdlib/constants-array-max-array-length' ); |
27 | | -var Float64Array = require( '@stdlib/array-float64' ); |
28 | | -var isArrayLikeObject = require( './../../dist' ); |
| 24 | +var main = require( './../../dist' ); |
29 | 25 |
|
30 | 26 |
|
31 | 27 | // TESTS // |
32 | 28 |
|
33 | | -tape( 'main export is a function', function test( t ) { |
| 29 | +tape( 'main export is defined', function test( t ) { |
34 | 30 | t.ok( true, __filename ); |
35 | | - t.strictEqual( typeof isArrayLikeObject, 'function', 'main export is a function' ); |
36 | | - t.end(); |
37 | | -}); |
38 | | - |
39 | | -tape( 'the function returns `true` if provided an array-like object', function test( t ) { |
40 | | - var values; |
41 | | - var i; |
42 | | - |
43 | | - values = [ |
44 | | - [], |
45 | | - { 'length': 10 }, |
46 | | - new Float64Array( 10 ), |
47 | | - arguments |
48 | | - ]; |
49 | | - |
50 | | - for ( i = 0; i < values.length; i++ ) { |
51 | | - t.strictEqual( isArrayLikeObject( values[i] ), true, 'returns true when provided '+values[i] ); |
52 | | - } |
53 | | - t.end(); |
54 | | -}); |
55 | | - |
56 | | -tape( 'the function returns `false` if provided an array-like object whose length exceeds the maximum array length', function test( t ) { |
57 | | - var o = { 'length': MAX_ARRAY_LENGTH+1 }; |
58 | | - t.strictEqual( isArrayLikeObject( o ), false, 'returns false' ); |
59 | | - t.end(); |
60 | | -}); |
61 | | - |
62 | | -tape( 'the function returns `false` if provided an array-like object whose length property is not an integer', function test( t ) { |
63 | | - var o = { 'length': 3.14 }; |
64 | | - t.strictEqual( isArrayLikeObject( o ), false, 'returns false' ); |
65 | | - t.end(); |
66 | | -}); |
67 | | - |
68 | | -tape( 'the function returns `false` if provided an array-like object whose length property is a negative integer', function test( t ) { |
69 | | - var o = { 'length': -1 }; |
70 | | - t.strictEqual( isArrayLikeObject( o ), false, 'returns false' ); |
71 | | - t.end(); |
72 | | -}); |
73 | | - |
74 | | -tape( 'the function returns `false` if not provided an array-like object', function test( t ) { |
75 | | - var values; |
76 | | - var i; |
77 | | - |
78 | | - values = [ |
79 | | - 'beep', |
80 | | - 5, |
81 | | - null, |
82 | | - void 0, |
83 | | - NaN, |
84 | | - true, |
85 | | - false, |
86 | | - {}, |
87 | | - function boop( a, b, c ) {} |
88 | | - ]; |
89 | | - |
90 | | - for ( i = 0; i < values.length; i++ ) { |
91 | | - t.strictEqual( isArrayLikeObject( values[i] ), false, 'returns false when provided '+values[i] ); |
92 | | - } |
| 31 | + t.strictEqual( main !== void 0, true, 'main export is defined' ); |
93 | 32 | t.end(); |
94 | 33 | }); |
0 commit comments