|
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 proxyquire = require( 'proxyquire' ); |
25 |
| -var nativeClass = require( './../../dist' ); |
| 24 | +var main = require( './../../dist' ); |
26 | 25 |
|
27 | 26 |
|
28 | 27 | // TESTS //
|
29 | 28 |
|
30 |
| -tape( 'main export is a function', function test( t ) { |
| 29 | +tape( 'main export is defined', function test( t ) { |
31 | 30 | t.ok( true, __filename );
|
32 |
| - t.strictEqual( typeof nativeClass, 'function', 'export is a function' ); |
| 31 | + t.strictEqual( main !== void 0, true, 'main export is defined' ); |
33 | 32 | t.end();
|
34 | 33 | });
|
35 |
| - |
36 |
| -tape( 'if an environment has `Symbol.toStringTag` support, the main export is a function which attempts to uncover the native `Symbol.toStringTag`', function test( t ) { |
37 |
| - var nativeClass = proxyquire( './../dist/index.js', { |
38 |
| - '@stdlib/assert-has-tostringtag-support': hasSupport, |
39 |
| - './polyfill.js': polyfill |
40 |
| - }); |
41 |
| - t.strictEqual( nativeClass, polyfill, 'exports expected function' ); |
42 |
| - t.end(); |
43 |
| - |
44 |
| - function hasSupport() { |
45 |
| - return true; |
46 |
| - } |
47 |
| - |
48 |
| - function polyfill() { |
49 |
| - // Polyfill... |
50 |
| - } |
51 |
| -}); |
52 |
| - |
53 |
| -tape( 'if an environment does not have `Symbol.toStringTag` support, the main export is a function which returns the value of the internal `[[Class]]` property', function test( t ) { |
54 |
| - var nativeClass = proxyquire( './../dist/index.js', { |
55 |
| - '@stdlib/assert-has-tostringtag-support': hasSupport, |
56 |
| - './main.js': foo |
57 |
| - }); |
58 |
| - |
59 |
| - t.strictEqual( nativeClass, foo, 'exports expected function' ); |
60 |
| - t.end(); |
61 |
| - |
62 |
| - function hasSupport() { |
63 |
| - return false; |
64 |
| - } |
65 |
| - |
66 |
| - function foo() { |
67 |
| - // Native class... |
68 |
| - } |
69 |
| -}); |
0 commit comments