Skip to content

Commit 842892d

Browse files
committed
test: use .strictEqual() instead of .equal() and fix lint errors
--- 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 9c21fd2 commit 842892d

File tree

173 files changed

+2417
-2377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+2417
-2377
lines changed

lib/node_modules/@stdlib/stats/anova1/test/test.js

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var randu = require( '@stdlib/random/base/randu' );
2525
var roundn = require( '@stdlib/math/base/special/roundn' );
2626
var contains = require( '@stdlib/assert/contains' );
2727
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
28+
var zeros = require( '@stdlib/array/base/zeros' );
2829
var anova1 = require( './../lib' );
2930

3031

@@ -191,14 +192,14 @@ tape( 'the function produces expected values on simple inputs', function test( t
191192
out = anova1( x, f );
192193

193194
// Tested against R:
194-
t.equal( out.treatment.df, 2 );
195-
t.equal( out.treatment.ss, 3.75 );
196-
t.equal( out.treatment.ms, 1.875 );
197-
t.equal( out.error.df, 7 );
198-
t.equal( out.error.ss, 96.75 );
199-
t.equal( roundn(out.error.ms, -4), 13.8214 );
200-
t.equal( roundn(out.statistic, -4), 0.1357 );
201-
t.equal( roundn(out.pValue, -4), 0.8754 );
195+
t.strictEqual( out.treatment.df, 2 );
196+
t.strictEqual( out.treatment.ss, 3.75 );
197+
t.strictEqual( out.treatment.ms, 1.875 );
198+
t.strictEqual( out.error.df, 7 );
199+
t.strictEqual( out.error.ss, 96.75 );
200+
t.strictEqual( roundn(out.error.ms, -4), 13.8214 );
201+
t.strictEqual( roundn(out.statistic, -4), 0.1357 );
202+
t.strictEqual( roundn(out.pValue, -4), 0.8754 );
202203
t.end();
203204
});
204205

@@ -211,16 +212,16 @@ tape( 'the `.print()` method allows printing a formatted output table', function
211212
var i;
212213

213214
len = 30;
214-
vals = new Array( len );
215-
group = new Array( len );
215+
vals = zeros( len );
216+
group = zeros( len );
216217
for ( i = 0; i < len; i++ ) {
217218
group[ i ] = discreteUniform( 0, 3 );
218219
vals[ i ] = ( randu()*50.0 ) + ( 10.0*group[ i ] );
219220
}
220221
actual = anova1( group, vals );
221222
table = actual.print();
222223

223-
t.equal( typeof table, 'string', 'returns a string' );
224+
t.strictEqual( typeof table, 'string', 'returns a string' );
224225
t.end();
225226
});
226227

@@ -233,8 +234,8 @@ tape( 'the function returns an object with a `.print()` method that accepts a `d
233234
var i;
234235

235236
len = 30;
236-
vals = new Array( len );
237-
group = new Array( len );
237+
vals = zeros( len );
238+
group = zeros( len );
238239
for ( i = 0; i < len; i++ ) {
239240
group[ i ] = discreteUniform( 0, 3 );
240241
vals[ i ] = ( randu()*50.0 ) + ( 10.0*group[ i ] );
@@ -243,7 +244,7 @@ tape( 'the function returns an object with a `.print()` method that accepts a `d
243244
table = actual.print({
244245
'digits': 6
245246
});
246-
t.equal( typeof table, 'string', 'returns a pretty-printed table' );
247+
t.strictEqual( typeof table, 'string', 'returns a pretty-printed table' );
247248
t.end();
248249
});
249250

@@ -256,8 +257,8 @@ tape( 'the function returns an object with a `.print()` method that accepts a `d
256257
var i;
257258

258259
len = 30;
259-
vals = new Array( len );
260-
group = new Array( len );
260+
vals = zeros( len );
261+
group = zeros( len );
261262
for ( i = 0; i < len; i++ ) {
262263
group[ i ] = discreteUniform( 0, 3 );
263264
vals[ i ] = ( randu()*50.0 ) + ( 10.0*group[ i ] );
@@ -266,8 +267,8 @@ tape( 'the function returns an object with a `.print()` method that accepts a `d
266267
table = actual.print({
267268
'decision': false
268269
});
269-
t.equal( typeof table, 'string', 'returns a pretty-printed table' );
270-
t.equal( contains( table, 'Test Decision' ), false, 'table does not contain test decision' );
270+
t.strictEqual( typeof table, 'string', 'returns a pretty-printed table' );
271+
t.strictEqual( contains( table, 'Test Decision' ), false, 'table does not contain test decision' );
271272
t.end();
272273
});
273274

@@ -282,7 +283,7 @@ tape( 'the function returns an object with a `.print()` method that accepts an `
282283
out = anova1( x, f );
283284
table = out.print( {} );
284285

285-
t.equal( typeof table, 'string', 'returns a pretty-printed table' );
286+
t.strictEqual( typeof table, 'string', 'returns a pretty-printed table' );
286287
t.end();
287288
});
288289

lib/node_modules/@stdlib/stats/anova1/test/test.validate.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ tape( 'the function returns a type error if not provided an options object', fun
5050

5151
for ( i = 0; i < values.length; i++ ) {
5252
err = validate( {}, values[i] );
53-
t.equal( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
53+
t.strictEqual( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
5454
}
5555
t.end();
5656
});
@@ -75,7 +75,7 @@ tape( 'the function returns a type error if provided a `alpha` option which is n
7575
err = validate( {}, {
7676
'alpha': values[i]
7777
});
78-
t.equal( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
78+
t.strictEqual( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
7979
}
8080
t.end();
8181
});
@@ -97,7 +97,7 @@ tape( 'the function returns `null` if all options are valid', function test( t )
9797

9898
err = validate( opts, options );
9999

100-
t.equal( err, null, 'returns null' );
100+
t.strictEqual( err, null, 'returns null' );
101101
t.deepEqual( opts, expected, 'extracts options' );
102102

103103
t.end();
@@ -118,7 +118,7 @@ tape( 'the function ignores unrecognized options', function test( t ) {
118118

119119
err = validate( opts, options );
120120

121-
t.equal( err, null, 'returns null' );
121+
t.strictEqual( err, null, 'returns null' );
122122
t.deepEqual( opts, {}, 'ignores unrecognized options' );
123123

124124
t.end();

lib/node_modules/@stdlib/stats/array/test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ tape( 'main export is an object', function test( t ) {
3535

3636
tape( 'the exported object contains key-value pairs', function test( t ) {
3737
var keys = objectKeys( ns );
38-
t.equal( keys.length > 0, true, 'returns expected value' );
38+
t.strictEqual( keys.length > 0, true, 'returns expected value' );
3939
t.end();
4040
});

lib/node_modules/@stdlib/stats/bartlett-test/test/test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,13 @@ tape( 'the function returns an object with a `.print()` method for printing a fo
194194

195195
out = bartlettTest( x, y, z );
196196
table = out.print();
197-
t.equal( typeof table, 'string', 'returns a string' );
197+
t.strictEqual( typeof table, 'string', 'returns a string' );
198198

199199
out = bartlettTest( x, y, z, {
200200
'alpha': 0.01
201201
});
202202
table = out.print();
203-
t.equal( typeof table, 'string', 'returns a string' );
203+
t.strictEqual( typeof table, 'string', 'returns a string' );
204204

205205
t.end();
206206
});
@@ -217,7 +217,7 @@ tape( 'the function returns an object with a `.print()` method that accepts a `d
217217
table = out.print({
218218
'digits': 6
219219
});
220-
t.equal( typeof table, 'string', 'returns a pretty-printed table' );
220+
t.strictEqual( typeof table, 'string', 'returns a pretty-printed table' );
221221
t.end();
222222
});
223223

@@ -233,8 +233,8 @@ tape( 'the function returns an object with a `.print()` method that accepts a `d
233233
table = out.print({
234234
'decision': false
235235
});
236-
t.equal( typeof table, 'string', 'returns a pretty-printed table' );
237-
t.equal( contains( table, 'Test Decision' ), false, 'table does not contain test decision' );
236+
t.strictEqual( typeof table, 'string', 'returns a pretty-printed table' );
237+
t.strictEqual( contains( table, 'Test Decision' ), false, 'table does not contain test decision' );
238238
t.end();
239239
});
240240

@@ -249,7 +249,7 @@ tape( 'the function returns an object with a `.print()` method that accepts an `
249249
out = bartlettTest( x, y, z );
250250
table = out.print( {} );
251251

252-
t.equal( typeof table, 'string', 'returns a pretty-printed table' );
252+
t.strictEqual( typeof table, 'string', 'returns a pretty-printed table' );
253253
t.end();
254254
});
255255

lib/node_modules/@stdlib/stats/bartlett-test/test/test.validate.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ tape( 'the function returns a type error if not provided an options object', fun
5050

5151
for ( i = 0; i < values.length; i++ ) {
5252
err = validate( {}, values[i] );
53-
t.equal( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
53+
t.strictEqual( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
5454
}
5555
t.end();
5656
});
@@ -75,7 +75,7 @@ tape( 'the function returns a type error if provided a `alpha` option which is n
7575
err = validate( {}, {
7676
'alpha': values[i]
7777
});
78-
t.equal( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
78+
t.strictEqual( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
7979
}
8080
t.end();
8181
});
@@ -100,7 +100,7 @@ tape( 'the function returns a type error if provided a `groups` option which is
100100
err = validate( {}, {
101101
'groups': values[i]
102102
});
103-
t.equal( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
103+
t.strictEqual( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
104104
}
105105
t.end();
106106
});
@@ -124,7 +124,7 @@ tape( 'the function returns `null` if all options are valid', function test( t )
124124

125125
err = validate( opts, options );
126126

127-
t.equal( err, null, 'returns null' );
127+
t.strictEqual( err, null, 'returns null' );
128128
t.deepEqual( opts, expected, 'extracts options' );
129129

130130
t.end();
@@ -145,7 +145,7 @@ tape( 'the function ignores unrecognized options', function test( t ) {
145145

146146
err = validate( opts, options );
147147

148-
t.equal( err, null, 'returns null' );
148+
t.strictEqual( err, null, 'returns null' );
149149
t.deepEqual( opts, {}, 'ignores unrecognized options' );
150150

151151
t.end();

lib/node_modules/@stdlib/stats/base/ndarray/test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ tape( 'main export is an object', function test( t ) {
3535

3636
tape( 'the exported object contains key-value pairs', function test( t ) {
3737
var keys = objectKeys( ns );
38-
t.equal( keys.length > 0, true, 'returns expected value' );
38+
t.strictEqual( keys.length > 0, true, 'returns expected value' );
3939
t.end();
4040
});

lib/node_modules/@stdlib/stats/base/test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ tape( 'main export is an object', function test( t ) {
3535

3636
tape( 'the exported object contains key-value pairs', function test( t ) {
3737
var keys = objectKeys( ns );
38-
t.equal( keys.length > 0, true, 'has keys' );
38+
t.strictEqual( keys.length > 0, true, 'has keys' );
3939
t.end();
4040
});

lib/node_modules/@stdlib/stats/binomial-test/test/test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,19 +273,19 @@ tape( 'the function returns an object with a `.print()` method for generating a
273273

274274
out = binomialTest( 682, 925 );
275275
table = out.print();
276-
t.equal( typeof table, 'string', 'returns a pretty-printed table' );
276+
t.strictEqual( typeof table, 'string', 'returns a pretty-printed table' );
277277

278278
out = binomialTest( 682, 925, {
279279
'alternative': 'less'
280280
});
281281
table = out.print();
282-
t.equal( typeof table, 'string', 'returns a pretty-printed table' );
282+
t.strictEqual( typeof table, 'string', 'returns a pretty-printed table' );
283283

284284
out = binomialTest( 682, 925, {
285285
'alternative': 'greater'
286286
});
287287
table = out.print();
288-
t.equal( typeof table, 'string', 'returns a pretty-printed table' );
288+
t.strictEqual( typeof table, 'string', 'returns a pretty-printed table' );
289289
t.end();
290290
});
291291

@@ -297,7 +297,7 @@ tape( 'the function returns an object with a `.print()` method that accepts a `d
297297
table = out.print({
298298
'digits': 6
299299
});
300-
t.equal( typeof table, 'string', 'returns a pretty-printed table' );
300+
t.strictEqual( typeof table, 'string', 'returns a pretty-printed table' );
301301
t.end();
302302
});
303303

@@ -309,8 +309,8 @@ tape( 'the function returns an object with a `.print()` method that accepts a `d
309309
table = out.print({
310310
'decision': false
311311
});
312-
t.equal( typeof table, 'string', 'returns a pretty-printed table' );
313-
t.equal( contains( table, 'Test Decision' ), false, 'table does not contain test decision' );
312+
t.strictEqual( typeof table, 'string', 'returns a pretty-printed table' );
313+
t.strictEqual( contains( table, 'Test Decision' ), false, 'table does not contain test decision' );
314314
t.end();
315315
});
316316

@@ -321,7 +321,7 @@ tape( 'the function returns an object with a `.print()` method that accepts an `
321321
out = binomialTest( 682, 925 );
322322
table = out.print( {} );
323323

324-
t.equal( typeof table, 'string', 'returns a pretty-printed table' );
324+
t.strictEqual( typeof table, 'string', 'returns a pretty-printed table' );
325325
t.end();
326326
});
327327

lib/node_modules/@stdlib/stats/binomial-test/test/test.validate.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ tape( 'the function returns a type error if not provided an options object', fun
5050

5151
for ( i = 0; i < values.length; i++ ) {
5252
err = validate( {}, values[i] );
53-
t.equal( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
53+
t.strictEqual( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
5454
}
5555
t.end();
5656
});
@@ -75,7 +75,7 @@ tape( 'the function returns a type error if provided a `alpha` option which is n
7575
err = validate( {}, {
7676
'alpha': values[i]
7777
});
78-
t.equal( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
78+
t.strictEqual( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
7979
}
8080
t.end();
8181
});
@@ -100,7 +100,7 @@ tape( 'the function returns a type error if provided an `alternative` option whi
100100
err = validate( {}, {
101101
'alternative': values[i]
102102
});
103-
t.equal( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
103+
t.strictEqual( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
104104
}
105105
t.end();
106106
});
@@ -125,7 +125,7 @@ tape( 'the function returns a type error if provided a `p` option which is not a
125125
err = validate( {}, {
126126
'p': values[i]
127127
});
128-
t.equal( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
128+
t.strictEqual( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
129129
}
130130
t.end();
131131
});
@@ -151,7 +151,7 @@ tape( 'the function returns `null` if all options are valid', function test( t )
151151

152152
err = validate( opts, options );
153153

154-
t.equal( err, null, 'returns null' );
154+
t.strictEqual( err, null, 'returns null' );
155155
t.deepEqual( opts, expected, 'extracts options' );
156156

157157
t.end();
@@ -172,7 +172,7 @@ tape( 'the function ignores unrecognized options', function test( t ) {
172172

173173
err = validate( opts, options );
174174

175-
t.equal( err, null, 'returns null' );
175+
t.strictEqual( err, null, 'returns null' );
176176
t.deepEqual( opts, {}, 'ignores unrecognized options' );
177177

178178
t.end();

lib/node_modules/@stdlib/stats/chi2gof/test/test.get_pmf.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ tape( 'main export is a function', function test( t ) {
4040
});
4141

4242
tape( 'the function returns the correct PMF if provided a valid input string', function test( t ) {
43-
t.equal( getPMF( 'bernoulli' ), bernoulliPMF );
44-
t.equal( getPMF( 'binomial' ), binomialPMF );
45-
t.equal( getPMF( 'discrete-uniform' ), discreteUniformPMF );
46-
t.equal( getPMF( 'geometric' ), geometricPMF );
47-
t.equal( getPMF( 'hypergeometric' ), hypergeometricPMF );
48-
t.equal( getPMF( 'negative-binomial' ), negativeBinomialPMF );
49-
t.equal( getPMF( 'poisson' ), poissonPMF );
43+
t.strictEqual( getPMF( 'bernoulli' ), bernoulliPMF );
44+
t.strictEqual( getPMF( 'binomial' ), binomialPMF );
45+
t.strictEqual( getPMF( 'discrete-uniform' ), discreteUniformPMF );
46+
t.strictEqual( getPMF( 'geometric' ), geometricPMF );
47+
t.strictEqual( getPMF( 'hypergeometric' ), hypergeometricPMF );
48+
t.strictEqual( getPMF( 'negative-binomial' ), negativeBinomialPMF );
49+
t.strictEqual( getPMF( 'poisson' ), poissonPMF );
5050
t.end();
5151
});
5252

@@ -79,7 +79,7 @@ tape( 'the function returns an error if provided the name of a continuous distri
7979

8080
for ( i = 0; i < values.length; i++ ) {
8181
out = getPMF( values[ i ] );
82-
t.equal( out instanceof Error, true, 'returns an error when provided '+values[i] );
82+
t.strictEqual( out instanceof Error, true, 'returns an error when provided '+values[i] );
8383
}
8484
t.end();
8585
});
@@ -105,7 +105,7 @@ tape( 'the function returns an error if provided a name which does not match any
105105

106106
for ( i = 0; i < values.length; i++ ) {
107107
out = getPMF( values[ i ] );
108-
t.equal( out instanceof Error, true, 'returns an error when provided '+values[i] );
108+
t.strictEqual( out instanceof Error, true, 'returns an error when provided '+values[i] );
109109
}
110110
t.end();
111111
});

0 commit comments

Comments
 (0)