|
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 no-new-wrappers */ |
20 | | - |
21 | 19 | 'use strict'; |
22 | 20 |
|
23 | 21 | // MODULES // |
24 | 22 |
|
25 | 23 | var tape = require( 'tape' ); |
26 | | -var Number = require( '@stdlib/number-ctor' ); |
27 | | -var isNumberArray = require( './../../dist' ); |
| 24 | +var main = require( './../../dist' ); |
28 | 25 |
|
29 | 26 |
|
30 | 27 | // TESTS // |
31 | 28 |
|
32 | | -tape( 'main export is a function', function test( t ) { |
| 29 | +tape( 'main export is defined', function test( t ) { |
33 | 30 | t.ok( true, __filename ); |
34 | | - t.strictEqual( typeof isNumberArray, 'function', 'main export is a function' ); |
35 | | - t.end(); |
36 | | -}); |
37 | | - |
38 | | -tape( 'the function tests for an array-like object containing only numbers', function test( t ) { |
39 | | - var arr; |
40 | | - |
41 | | - arr = [ 1, new Number( 2 ), 3, new Number( 4 ) ]; |
42 | | - t.strictEqual( isNumberArray( arr ), true, 'returns true' ); |
43 | | - |
44 | | - arr = { |
45 | | - 'length': 2, |
46 | | - '0': 1, |
47 | | - '1': 2 |
48 | | - }; |
49 | | - t.strictEqual( isNumberArray( arr ), true, 'returns true' ); |
50 | | - |
51 | | - arr = [ 1, '2', 3 ]; |
52 | | - t.strictEqual( isNumberArray( arr ), false, 'returns false' ); |
53 | | - |
54 | | - t.end(); |
55 | | -}); |
56 | | - |
57 | | -tape( 'the function provides a method to test for an array-like object containing only number primitives', function test( t ) { |
58 | | - var arr; |
59 | | - |
60 | | - arr = [ 1, 2, 3, 4 ]; |
61 | | - t.strictEqual( isNumberArray.primitives( arr ), true, 'returns true' ); |
62 | | - |
63 | | - arr = { |
64 | | - 'length': 2, |
65 | | - '0': 1, |
66 | | - '1': 2 |
67 | | - }; |
68 | | - t.strictEqual( isNumberArray.primitives( arr ), true, 'returns true' ); |
69 | | - |
70 | | - arr = [ new Number( 1 ), 2, 3 ]; |
71 | | - t.strictEqual( isNumberArray.primitives( arr ), false, 'returns false' ); |
72 | | - |
73 | | - t.end(); |
74 | | -}); |
75 | | - |
76 | | -tape( 'the function provides a method to test for an array-like object containing only `Number` objects', function test( t ) { |
77 | | - var arr; |
78 | | - |
79 | | - arr = [ new Number( 1 ), new Number( 2 ), new Number( 3 ) ]; |
80 | | - t.strictEqual( isNumberArray.objects( arr ), true, 'returns true' ); |
81 | | - |
82 | | - arr = { |
83 | | - 'length': 2, |
84 | | - '0': new Number( 1 ), |
85 | | - '1': new Number( 2 ) |
86 | | - }; |
87 | | - t.strictEqual( isNumberArray.objects( arr ), true, 'returns true' ); |
88 | | - |
89 | | - arr = [ new Number( 1 ), 2, 3 ]; |
90 | | - t.strictEqual( isNumberArray.objects( arr ), false, 'returns false' ); |
91 | | - |
| 31 | + t.strictEqual( main !== void 0, true, 'main export is defined' ); |
92 | 32 | t.end(); |
93 | 33 | }); |
0 commit comments