Skip to content

Commit c4f7bbd

Browse files
committed
Always assert when a benchmark finishes
1 parent 11ac0ef commit c4f7bbd

File tree

1 file changed

+14
-19
lines changed
  • lib/node_modules/@stdlib/assert/is-integer/benchmark

1 file changed

+14
-19
lines changed

lib/node_modules/@stdlib/assert/is-integer/benchmark/benchmark.js

+14-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable no-new-wrappers, no-undefined, no-empty-function */
1+
/* eslint-disable no-new-wrappers, no-empty-function */
22
'use strict';
33

44
// MODULES //
@@ -27,7 +27,7 @@ bench( pkg+'::primitives', function benchmark( b ) {
2727
true,
2828
false,
2929
null,
30-
undefined
30+
void 0
3131
];
3232

3333
b.tic();
@@ -38,11 +38,10 @@ bench( pkg+'::primitives', function benchmark( b ) {
3838
}
3939
}
4040
b.toc();
41-
if ( isBoolean( bool ) ) {
42-
b.pass( 'benchmark finished' );
43-
} else {
41+
if ( !isBoolean( bool ) ) {
4442
b.fail( 'should return a boolean' );
4543
}
44+
b.pass( 'benchmark finished' );
4645
b.end();
4746
});
4847

@@ -68,11 +67,10 @@ bench( pkg+'::objects', function benchmark( b ) {
6867
}
6968
}
7069
b.toc();
71-
if ( isBoolean( bool ) ) {
72-
b.pass( 'benchmark finished' );
73-
} else {
70+
if ( !isBoolean( bool ) ) {
7471
b.fail( 'should return a boolean' );
7572
}
73+
b.pass( 'benchmark finished' );
7674
b.end();
7775
});
7876

@@ -92,7 +90,7 @@ bench( pkg+'::primitives:isPrimitive', function benchmark( b ) {
9290
true,
9391
false,
9492
null,
95-
undefined
93+
void 0
9694
];
9795

9896
b.tic();
@@ -103,11 +101,10 @@ bench( pkg+'::primitives:isPrimitive', function benchmark( b ) {
103101
}
104102
}
105103
b.toc();
106-
if ( isBoolean( bool ) ) {
107-
b.pass( 'benchmark finished' );
108-
} else {
104+
if ( !isBoolean( bool ) ) {
109105
b.fail( 'should return a boolean' );
110106
}
107+
b.pass( 'benchmark finished' );
111108
b.end();
112109
});
113110

@@ -157,7 +154,7 @@ bench( pkg+'::primitives:isObject', function benchmark( b ) {
157154
true,
158155
false,
159156
null,
160-
undefined
157+
void 0
161158
];
162159

163160
b.tic();
@@ -168,11 +165,10 @@ bench( pkg+'::primitives:isObject', function benchmark( b ) {
168165
}
169166
}
170167
b.toc();
171-
if ( isBoolean( bool ) ) {
172-
b.pass( 'benchmark finished' );
173-
} else {
168+
if ( !isBoolean( bool ) ) {
174169
b.fail( 'should return a boolean' );
175170
}
171+
b.pass( 'benchmark finished' );
176172
b.end();
177173
});
178174

@@ -198,10 +194,9 @@ bench( pkg+'::objects:isObject', function benchmark( b ) {
198194
}
199195
}
200196
b.toc();
201-
if ( isBoolean( bool ) ) {
202-
b.pass( 'benchmark finished' );
203-
} else {
197+
if ( !isBoolean( bool ) ) {
204198
b.fail( 'should return a boolean' );
205199
}
200+
b.pass( 'benchmark finished' );
206201
b.end();
207202
});

0 commit comments

Comments
 (0)