|
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 detect = 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 detect, 'function', 'main export is a function' ); |
33 | | - t.end(); |
34 | | -}); |
35 | | - |
36 | | -tape( 'feature detection result is a boolean', function test( t ) { |
37 | | - t.strictEqual( typeof detect(), 'boolean', 'detection result is a boolean' ); |
38 | | - t.end(); |
39 | | -}); |
40 | | - |
41 | | -tape( 'if functions have a `name` property, detection result is `true`', function test( t ) { |
42 | | - var detect; |
43 | | - var stub; |
44 | | - |
45 | | - stub = {}; |
46 | | - stub.name = 'foo'; |
47 | | - |
48 | | - detect = proxyquire( './../dist/main.js', { |
49 | | - './foo.js': stub |
50 | | - }); |
51 | | - |
52 | | - t.strictEqual( detect(), true, 'detection result is `true`' ); |
53 | | - t.end(); |
54 | | -}); |
55 | | - |
56 | | -tape( 'if functions do not have a `name` property, detection result is `false`', function test( t ) { |
57 | | - var detect; |
58 | | - var stub; |
59 | | - |
60 | | - stub = {}; |
61 | | - stub.name = null; |
62 | | - |
63 | | - detect = proxyquire( './../dist/main.js', { |
64 | | - './foo.js': stub |
65 | | - }); |
66 | | - |
67 | | - t.strictEqual( detect(), false, 'detection result is `false`' ); |
| 31 | + t.strictEqual( main !== void 0, true, 'main export is defined' ); |
68 | 32 | t.end(); |
69 | 33 | }); |
0 commit comments