|
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 Number = require( '@stdlib/number-ctor' ); |
25 |
| -var Boolean = require( '@stdlib/boolean-ctor' ); |
26 |
| -var Fcn = require( '@stdlib/function-ctor' ); |
27 |
| -var Object = require( '@stdlib/object-ctor' ); |
28 |
| -var getPrototypeOf = 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 getPrototypeOf, 'function', 'export is a function' ); |
36 |
| - t.end(); |
37 |
| -}); |
38 |
| - |
39 |
| -tape( 'the function returns `null` if provided either `null` or `undefined`', function test( t ) { |
40 |
| - var proto; |
41 |
| - |
42 |
| - proto = getPrototypeOf( null ); |
43 |
| - t.equal( proto, null, 'returns `null` when provided `null`' ); |
44 |
| - |
45 |
| - proto = getPrototypeOf( void 0 ); |
46 |
| - t.equal( proto, null, 'returns `null` when provided `undefined`' ); |
47 |
| - |
48 |
| - t.end(); |
49 |
| -}); |
50 |
| - |
51 |
| -tape( 'the function returns the prototype of a provided value', function test( t ) { |
52 |
| - var expected; |
53 |
| - var values; |
54 |
| - var actual; |
55 |
| - var i; |
56 |
| - |
57 |
| - values = [ |
58 |
| - 'beep', |
59 |
| - new String( 'boop' ), // eslint-disable-line no-new-wrappers |
60 |
| - 5, |
61 |
| - new Number( 3.14 ), // eslint-disable-line no-new-wrappers |
62 |
| - true, |
63 |
| - new Boolean( false ), // eslint-disable-line no-new-wrappers |
64 |
| - [], |
65 |
| - {}, |
66 |
| - function foo() {}, |
67 |
| - new Date(), |
68 |
| - /.*/, |
69 |
| - new RegExp( '.*' ) // eslint-disable-line prefer-regex-literals |
70 |
| - ]; |
71 |
| - |
72 |
| - expected = [ |
73 |
| - String.prototype, |
74 |
| - String.prototype, |
75 |
| - Number.prototype, |
76 |
| - Number.prototype, |
77 |
| - Boolean.prototype, |
78 |
| - Boolean.prototype, |
79 |
| - Array.prototype, |
80 |
| - Object.prototype, |
81 |
| - Fcn.prototype, |
82 |
| - Date.prototype, |
83 |
| - RegExp.prototype, |
84 |
| - RegExp.prototype |
85 |
| - ]; |
86 |
| - |
87 |
| - for ( i = 0; i < values.length; i++ ) { |
88 |
| - actual = getPrototypeOf( values[i] ); |
89 |
| - t.equal( actual, expected[i], 'returns expected prototype when provided '+values[i] ); |
90 |
| - } |
91 |
| - t.end(); |
92 |
| -}); |
93 |
| - |
94 |
| -tape( 'the function returns `null` if provided an object created via `Object.create( null )`', function test( t ) { |
95 |
| - var proto = getPrototypeOf( Object.create( null ) ); |
96 |
| - t.equal( proto, null, 'returns null' ); |
| 31 | + t.strictEqual( main !== void 0, true, 'main export is defined' ); |
97 | 32 | t.end();
|
98 | 33 | });
|
0 commit comments