Skip to content

Commit db8d7ce

Browse files
committed
Auto-generated commit
1 parent ac7f85d commit db8d7ce

File tree

3 files changed

+13
-115
lines changed

3 files changed

+13
-115
lines changed

.github/.keepalive

-1
This file was deleted.

package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@
4040
"url": "https://github.com/stdlib-js/stdlib/issues"
4141
},
4242
"dependencies": {
43-
"@stdlib/assert-is-int16array": "^0.1.0",
44-
"@stdlib/cli-ctor": "^0.1.0",
45-
"@stdlib/constants-int16-max": "^0.1.0",
46-
"@stdlib/constants-int16-min": "^0.1.0",
47-
"@stdlib/fs-read-file": "^0.1.0"
43+
"@stdlib/assert-is-int16array": "^0.1.1",
44+
"@stdlib/cli-ctor": "^0.1.1",
45+
"@stdlib/constants-int16-max": "^0.1.1",
46+
"@stdlib/constants-int16-min": "^0.1.1",
47+
"@stdlib/fs-read-file": "^0.1.1"
4848
},
4949
"devDependencies": {
5050
"@stdlib/array-int16": "^0.1.0",
51-
"@stdlib/assert-is-boolean": "^0.1.0",
52-
"@stdlib/assert-is-browser": "^0.1.0",
53-
"@stdlib/assert-is-windows": "^0.1.0",
51+
"@stdlib/assert-is-boolean": "^0.1.1",
52+
"@stdlib/assert-is-browser": "^0.1.1",
53+
"@stdlib/assert-is-windows": "^0.1.1",
5454
"@stdlib/bench": "^0.1.0",
55-
"@stdlib/process-exec-path": "^0.1.0",
55+
"@stdlib/process-exec-path": "^0.1.1",
5656
"proxyquire": "^2.0.0",
5757
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
5858
"istanbul": "^0.4.1",

test/dist/test.js

+4-105
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,114 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var proxyquire = require( 'proxyquire' );
25-
var Int16Array = require( '@stdlib/array-int16' );
26-
var detect = require( './../../dist' );
27-
28-
29-
// VARIABLES //
30-
31-
var hasInt16Array = ( typeof Int16Array === '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 `Int16Array` is supported, detection result is `true`', function test( t ) {
48-
var mocked;
49-
if ( hasInt16Array ) {
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-
'./int16array.js': Mock,
56-
'@stdlib/assert-is-int16array': 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-
-3,
71-
-32768
72-
];
73-
}
74-
});
75-
76-
tape( 'if `Int16Array` is not supported, detection result is `false`', function test( t ) {
77-
var mocked;
78-
if ( hasInt16Array ) {
79-
t.strictEqual( detect(), true, 'detection result is `true`' );
80-
} else {
81-
t.strictEqual( detect(), false, 'detection result is `false`' );
82-
}
83-
mocked = proxyquire( './../dist/main.js', {
84-
'./int16array.js': {}
85-
});
86-
t.strictEqual( mocked(), false, 'detection result is `false`' );
87-
88-
mocked = proxyquire( './../dist/main.js', {
89-
'./int16array.js': Mock1
90-
});
91-
t.strictEqual( mocked(), false, 'detection result is `false`' );
92-
93-
mocked = proxyquire( './../dist/main.js', {
94-
'./int16array.js': Mock2,
95-
'@stdlib/assert-is-int16array': isArray
96-
});
97-
t.strictEqual( mocked(), false, 'detection result is `false`' );
98-
99-
mocked = proxyquire( './../dist/main.js', {
100-
'./int16array.js': Mock3,
101-
'@stdlib/assert-is-int16array': isArray
102-
});
103-
t.strictEqual( mocked(), false, 'detection result is `false`' );
104-
105-
mocked = proxyquire( './../dist/main.js', {
106-
'./int16array.js': Mock4
107-
});
108-
t.strictEqual( mocked(), false, 'detection result is `false`' );
109-
110-
t.end();
111-
112-
function isArray() {
113-
return true;
114-
}
115-
116-
function Mock1() {
117-
// Not a typed array:
118-
return [];
119-
}
120-
121-
function Mock2() {
122-
// Does not truncate...
123-
return [ 1, 3.14, -3.14, -32768 ];
124-
}
125-
126-
function Mock3() {
127-
// Does not wrap around...
128-
return [ 1, 3, -3, 32768 ];
129-
}
130-
131-
function Mock4() {
132-
throw new Error( 'beep' );
133-
}
134-
});

0 commit comments

Comments
 (0)