Skip to content

Commit dceca5a

Browse files
committed
test: fix addon tests
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 8af2d8d commit dceca5a

File tree

1 file changed

+19
-10
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/logistic/logpdf/test

1 file changed

+19
-10
lines changed

Diff for: lib/node_modules/@stdlib/stats/base/dists/logistic/logpdf/test/test.native.js

+19-10
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020

2121
// MODULES //
2222

23+
var resolve = require( 'path' ).resolve;
2324
var tape = require( 'tape' );
25+
var tryRequire = require( '@stdlib/utils/try-require' );
2426
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2527
var abs = require( '@stdlib/math/base/special/abs' );
2628
var PINF = require( '@stdlib/constants/float64/pinf' );
2729
var NINF = require( '@stdlib/constants/float64/ninf' );
2830
var EPS = require( '@stdlib/constants/float64/eps' );
29-
var logpdf = require( './../lib' );
3031

3132

3233
// FIXTURES //
@@ -36,15 +37,23 @@ var negativeMean = require( './fixtures/julia/negative_mean.json' );
3637
var largeVariance = require( './fixtures/julia/large_variance.json' );
3738

3839

40+
// VARIABLES //
41+
42+
var logpdf = tryRequire( resolve( __dirname, './../lib/native.js' ) );
43+
var opts = {
44+
'skip': ( logpdf instanceof Error )
45+
};
46+
47+
3948
// TESTS //
4049

41-
tape( 'main export is a function', function test( t ) {
50+
tape( 'main export is a function', opts, function test( t ) {
4251
t.ok( true, __filename );
4352
t.strictEqual( typeof logpdf, 'function', 'main export is a function' );
4453
t.end();
4554
});
4655

47-
tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) {
56+
tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) {
4857
var y = logpdf( NaN, 0.0, 1.0 );
4958
t.equal( isnan( y ), true, 'returns NaN' );
5059
y = logpdf( 0.0, NaN, 1.0 );
@@ -54,19 +63,19 @@ tape( 'if provided `NaN` for any parameter, the function returns `NaN`', functio
5463
t.end();
5564
});
5665

57-
tape( 'if provided `+infinity` for `x` and a finite `mu` and `s`, the function returns `-infinity`', function test( t ) {
66+
tape( 'if provided `+infinity` for `x` and a finite `mu` and `s`, the function returns `-infinity`', opts, function test( t ) {
5867
var y = logpdf( PINF, 0.0, 1.0 );
5968
t.equal( y, NINF, 'returns -infinity' );
6069
t.end();
6170
});
6271

63-
tape( 'if provided `-infinity` for `x` and a finite `mu` and `s`, the function returns `-infinity`', function test( t ) {
72+
tape( 'if provided `-infinity` for `x` and a finite `mu` and `s`, the function returns `-infinity`', opts, function test( t ) {
6473
var y = logpdf( NINF, 0.0, 1.0 );
6574
t.equal( y, NINF, 'returns -infinity' );
6675
t.end();
6776
});
6877

69-
tape( 'if provided a negative `s`, the function returns `NaN`', function test( t ) {
78+
tape( 'if provided a negative `s`, the function returns `NaN`', opts, function test( t ) {
7079
var y;
7180

7281
y = logpdf( 2.0, 2.0, -1.0 );
@@ -90,7 +99,7 @@ tape( 'if provided a negative `s`, the function returns `NaN`', function test( t
9099
t.end();
91100
});
92101

93-
tape( 'if provided `s` equal to `0`, the function evaluates a degenerate distribution centered at `mu`', function test( t ) {
102+
tape( 'if provided `s` equal to `0`, the function evaluates a degenerate distribution centered at `mu`', opts, function test( t ) {
94103
var y;
95104

96105
y = logpdf( 2.0, 2.0, 0.0 );
@@ -111,7 +120,7 @@ tape( 'if provided `s` equal to `0`, the function evaluates a degenerate distrib
111120
t.end();
112121
});
113122

114-
tape( 'the function evaluates the logpdf for `x` given positive `mu`', function test( t ) {
123+
tape( 'the function evaluates the logpdf for `x` given positive `mu`', opts, function test( t ) {
115124
var expected;
116125
var delta;
117126
var tol;
@@ -140,7 +149,7 @@ tape( 'the function evaluates the logpdf for `x` given positive `mu`', function
140149
t.end();
141150
});
142151

143-
tape( 'the function evaluates the logpdf for `x` given negative `mu`', function test( t ) {
152+
tape( 'the function evaluates the logpdf for `x` given negative `mu`', opts, function test( t ) {
144153
var expected;
145154
var delta;
146155
var tol;
@@ -169,7 +178,7 @@ tape( 'the function evaluates the logpdf for `x` given negative `mu`', function
169178
t.end();
170179
});
171180

172-
tape( 'the function evaluates the logpdf for `x` given large variance ( = large `s` )', function test( t ) {
181+
tape( 'the function evaluates the logpdf for `x` given large variance ( = large `s` )', opts, function test( t ) {
173182
var expected;
174183
var delta;
175184
var tol;

0 commit comments

Comments
 (0)