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 2a0a9f9 commit 4958b99
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 59 deletions.
1 change: 0 additions & 1 deletion .github/.keepalive

This file was deleted.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@
"url": "https://github.com/stdlib-js/stdlib/issues"
},
"dependencies": {
"@stdlib/assert-has-uint8clampedarray-support": "^0.1.0"
"@stdlib/assert-has-uint8clampedarray-support": "^0.1.1"
},
"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-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-nonnegative-integer": "^0.1.0",
"@stdlib/assert-is-uint8clampedarray": "^0.1.0",
"@stdlib/assert-is-uint8clampedarray": "^0.1.1",
"@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 hasUint8ClampedArraySupport = require( '@stdlib/assert-has-uint8clampedarray-support' );
var polyfill = require( './../../dist/polyfill.js' );
var ctor = require( './../../dist' );


// VARIABLES //

var hasUint8ClampedArrays = hasUint8ClampedArraySupport();
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 `Uint8ClampedArray`, the export is an alias for `Uint8ClampedArray`', function test( t ) {
var Foo;

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

if ( hasUint8ClampedArrays ) {
t.strictEqual( ctor, Uint8ClampedArray, '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 `Uint8ClampedArray`, the export is a polyfill', function test( t ) {
var Foo;

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

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

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

0 comments on commit 4958b99

Please sign in to comment.