Skip to content

Commit 4803a8c

Browse files
committed
Fix broken tests due to moving to using @stdlib/symbol/ctor
1 parent ffa286f commit 4803a8c

File tree

1 file changed

+9
-12
lines changed
  • lib/node_modules/@stdlib/assert/has-iterator-symbol-support/test

1 file changed

+9
-12
lines changed

lib/node_modules/@stdlib/assert/has-iterator-symbol-support/test/test.js

+9-12
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' );
24+
var proxyquire = require( 'proxyquire' );
25+
var Symbol = require( '@stdlib/symbol/ctor' );
2526
var detect = require( './../lib' );
2627

2728

2829
// VARIABLES //
2930

30-
var hasSymbols = hasSymbolSupport();
3131
var hasIteratorSymbol = ( typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' );
3232

3333

@@ -54,16 +54,13 @@ tape( 'if `Symbol.iterator` is supported, detection result is `true`', function
5454
});
5555

5656
tape( 'the function guards against a `Symbol` global variable which does not produce `symbols`', function test( t ) {
57-
var tmp;
58-
if ( hasSymbols ) {
59-
tmp = Symbol;
60-
Symbol = {}; // eslint-disable-line no-global-assign
61-
} else {
62-
global.Symbol = {};
63-
}
57+
var detect = proxyquire( './../lib/main.js', {
58+
'@stdlib/symbol/ctor': mock
59+
});
6460
t.strictEqual( detect(), false, 'detection result is `false`' );
65-
if ( hasSymbols ) {
66-
Symbol = tmp; // eslint-disable-line no-global-assign
67-
}
6861
t.end();
62+
63+
function mock() {
64+
return {};
65+
}
6966
});

0 commit comments

Comments
 (0)