Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Oct 5, 2023
1 parent 09735f5 commit 3c03d75
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 58 deletions.
1 change: 0 additions & 1 deletion .github/.keepalive

This file was deleted.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
"@stdlib/assert-has-int32array-support": "^0.1.0"
},
"devDependencies": {
"@stdlib/assert-has-property": "^0.1.0",
"@stdlib/assert-is-arraybuffer": "^0.1.0",
"@stdlib/assert-is-boolean": "^0.1.0",
"@stdlib/assert-is-function": "^0.1.0",
"@stdlib/assert-is-int32array": "^0.1.0",
"@stdlib/assert-has-property": "^0.1.1",
"@stdlib/assert-is-arraybuffer": "^0.1.1",
"@stdlib/assert-is-boolean": "^0.1.1",
"@stdlib/assert-is-function": "^0.1.1",
"@stdlib/assert-is-int32array": "^0.1.1",
"@stdlib/assert-is-nonnegative-integer": "^0.1.0",
"@stdlib/bench": "^0.1.0",
"@stdlib/math-base-special-pow": "^0.1.0",
"@stdlib/math-base-special-round": "^0.1.0",
"@stdlib/math-base-special-round": "^0.1.1",
"@stdlib/random-base-randi": "^0.1.0",
"@stdlib/random-base-randu": "^0.1.0",
"@stdlib/symbol-iterator": "^0.1.0",
Expand Down
55 changes: 4 additions & 51 deletions test/dist/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
* Copyright (c) 2023 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,60 +21,13 @@
// MODULES //

var tape = require( 'tape' );
var proxyquire = require( 'proxyquire' );
var hasInt32ArraySupport = require( '@stdlib/assert-has-int32array-support' );
var polyfill = require( './../../dist/polyfill.js' );
var ctor = require( './../../dist' );


// VARIABLES //

var hasInt32Arrays = hasInt32ArraySupport();
var main = require( './../../dist' );


// TESTS //

tape( 'main export is a function', function test( t ) {
tape( 'main export is defined', function test( t ) {
t.ok( true, __filename );
t.strictEqual( typeof ctor, 'function', 'main export is a function' );
t.end();
});

tape( 'if an environment supports `Int32Array`, the export is an alias for `Int32Array`', function test( t ) {
var Foo;

Foo = proxyquire( './../dist', {
'@stdlib/assert-has-int32array-support': isTrue,
'./main.js': Mock
});
t.strictEqual( Foo, Mock, 'returns builtin' );

if ( hasInt32Arrays ) {
t.strictEqual( ctor, Int32Array, 'is alias' ); // eslint-disable-line stdlib/require-globals
}

t.strictEqual( main !== void 0, true, 'main export is defined' );
t.end();

function Mock() {
return this;
}

function isTrue() {
return true;
}
});

tape( 'if an environment does not support `Int32Array`, the export is a polyfill', function test( t ) {
var Foo;

Foo = proxyquire( './../dist', {
'@stdlib/assert-has-int32array-support': isFalse
});

t.strictEqual( Foo, polyfill, 'returns polyfill' );
t.end();

function isFalse() {
return false;
}
});

0 comments on commit 3c03d75

Please sign in to comment.