Skip to content

Commit 7e584d8

Browse files
committed
Auto-generated commit
1 parent d2a68ea commit 7e584d8

File tree

3 files changed

+12
-114
lines changed

3 files changed

+12
-114
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
197197
[npm-image]: http://img.shields.io/npm/v/@stdlib/assert-has-uint32array-support.svg
198198
[npm-url]: https://npmjs.org/package/@stdlib/assert-has-uint32array-support
199199

200-
[test-image]: https://github.com/stdlib-js/assert-has-uint32array-support/actions/workflows/test.yml/badge.svg?branch=v0.1.1
201-
[test-url]: https://github.com/stdlib-js/assert-has-uint32array-support/actions/workflows/test.yml?query=branch:v0.1.1
200+
[test-image]: https://github.com/stdlib-js/assert-has-uint32array-support/actions/workflows/test.yml/badge.svg?branch=main
201+
[test-url]: https://github.com/stdlib-js/assert-has-uint32array-support/actions/workflows/test.yml?query=branch:main
202202

203203
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/assert-has-uint32array-support/main.svg
204204
[coverage-url]: https://codecov.io/github/stdlib-js/assert-has-uint32array-support?branch=main

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@
4040
"url": "https://github.com/stdlib-js/stdlib/issues"
4141
},
4242
"dependencies": {
43-
"@stdlib/assert-is-uint32array": "^0.1.0",
43+
"@stdlib/assert-is-uint32array": "^0.1.1",
4444
"@stdlib/cli-ctor": "^0.1.1",
45-
"@stdlib/constants-uint32-max": "^0.1.0",
45+
"@stdlib/constants-uint32-max": "^0.1.1",
4646
"@stdlib/fs-read-file": "^0.1.1"
4747
},
4848
"devDependencies": {
4949
"@stdlib/array-uint32": "^0.1.0",
50-
"@stdlib/assert-is-boolean": "^0.1.0",
51-
"@stdlib/assert-is-browser": "^0.1.0",
52-
"@stdlib/assert-is-windows": "^0.1.0",
50+
"@stdlib/assert-is-boolean": "^0.1.1",
51+
"@stdlib/assert-is-browser": "^0.1.1",
52+
"@stdlib/assert-is-windows": "^0.1.1",
5353
"@stdlib/bench": "^0.1.0",
54-
"@stdlib/process-exec-path": "^0.1.0",
54+
"@stdlib/process-exec-path": "^0.1.1",
5555
"proxyquire": "^2.0.0",
5656
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
5757
"istanbul": "^0.4.1",

test/dist/test.js

Lines changed: 4 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2018 The Stdlib Authors.
4+
* Copyright (c) 2023 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -21,115 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var proxyquire = require( 'proxyquire' );
25-
var Uint32Array = require( '@stdlib/array-uint32' );
26-
var detect = require( './../../dist' );
27-
28-
29-
// VARIABLES //
30-
31-
var hasUint32Array = ( typeof Uint32Array === 'function' );
24+
var main = require( './../../dist' );
3225

3326

3427
// TESTS //
3528

36-
tape( 'main export is a function', function test( t ) {
29+
tape( 'main export is defined', function test( t ) {
3730
t.ok( true, __filename );
38-
t.strictEqual( typeof detect, 'function', 'main export is a function' );
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
3932
t.end();
4033
});
41-
42-
tape( 'feature detection result is a boolean', function test( t ) {
43-
t.strictEqual( typeof detect(), 'boolean', 'detection result is a boolean' );
44-
t.end();
45-
});
46-
47-
tape( 'if `Uint32Array` is supported, detection result is `true`', function test( t ) {
48-
var mocked;
49-
if ( hasUint32Array ) {
50-
t.strictEqual( detect(), true, 'detection result is `true`' );
51-
} else {
52-
t.strictEqual( detect(), false, 'detection result is `false`' );
53-
}
54-
mocked = proxyquire( './../dist/main.js', {
55-
'./uint32array.js': Mock,
56-
'@stdlib/assert-is-uint32array': isArray
57-
});
58-
t.strictEqual( mocked(), true, 'detection result is `true` (mocked)' );
59-
60-
t.end();
61-
62-
function isArray() {
63-
return true;
64-
}
65-
66-
function Mock() {
67-
return [
68-
1,
69-
3,
70-
4294967293,
71-
0,
72-
1
73-
];
74-
}
75-
});
76-
77-
tape( 'if `Uint32Array` is not supported, detection result is `false`', function test( t ) {
78-
var mocked;
79-
if ( hasUint32Array ) {
80-
t.strictEqual( detect(), true, 'detection result is `true`' );
81-
} else {
82-
t.strictEqual( detect(), false, 'detection result is `false`' );
83-
}
84-
mocked = proxyquire( './../dist/main.js', {
85-
'./uint32array.js': {}
86-
});
87-
t.strictEqual( mocked(), false, 'detection result is `false`' );
88-
89-
mocked = proxyquire( './../dist/main.js', {
90-
'./uint32array.js': Mock1
91-
});
92-
t.strictEqual( mocked(), false, 'detection result is `false`' );
93-
94-
mocked = proxyquire( './../dist/main.js', {
95-
'./uint32array.js': Mock2,
96-
'@stdlib/assert-is-uint32array': isArray
97-
});
98-
t.strictEqual( mocked(), false, 'detection result is `false`' );
99-
100-
mocked = proxyquire( './../dist/main.js', {
101-
'./uint32array.js': Mock3,
102-
'@stdlib/assert-is-uint32array': isArray
103-
});
104-
t.strictEqual( mocked(), false, 'detection result is `false`' );
105-
106-
mocked = proxyquire( './../dist/main.js', {
107-
'./uint32array.js': Mock4
108-
});
109-
t.strictEqual( mocked(), false, 'detection result is `false`' );
110-
111-
t.end();
112-
113-
function isArray() {
114-
return true;
115-
}
116-
117-
function Mock1() {
118-
// Not a typed array:
119-
return [];
120-
}
121-
122-
function Mock2() {
123-
// Does not truncate...
124-
return [ 1, 3.14, -3.14, 0, 1 ];
125-
}
126-
127-
function Mock3() {
128-
// Does not wrap around...
129-
return [ 1, 3, 4294967293, 4294967296, 4294967297 ];
130-
}
131-
132-
function Mock4() {
133-
throw new Error( 'beep' );
134-
}
135-
});

0 commit comments

Comments
 (0)