@@ -98,10 +98,10 @@ module.exports = {
9898// a queryish object with all kinds of functions
9999function Queryish ( ) { }
100100async function dummy_1 ( ) {
101- return Queryish . count ++ ;
101+ Queryish . count ++ ;
102102}
103103async function dummy_2 ( a ) {
104- //return Queryish.count++;
104+ Queryish . count ++ ;
105105}
106106
107107Queryish . count = 0 ;
@@ -172,31 +172,29 @@ module.exports = {
172172 FileVersion,
173173 Version,
174174 db,
175- Queryish
175+ Queryish,
176176} ;
177177
178178} , { } ] , 3 :[ function ( require , module , exports ) {
179179const doxbee = require ( "../lib/doxbee-async" ) ;
180180
181181globalThis . Benchmark = class {
182- count = 0 ;
183-
184- async runIteration ( ) {
182+ runIteration ( ) {
185183 doxbee . fakes . Queryish . count = 0 ;
186184 const promises = new Array ( 10_000 ) ;
187185
188186 for ( var i = 0 ; i < 10_000 ; i ++ )
189187 promises [ i ] = doxbee . doxbee ( i , "foo" ) ;
190188
191- await Promise . all ( promises ) ;
192- this . count = doxbee . fakes . Queryish . count ;
189+ return Promise . all ( promises ) ;
193190 }
194191
195192 validate ( ) {
196- // const EXPECTED_COUNT = 60000;
197- // if (this.count !== EXPECTED_COUNT) {
198- // throw new Error(`Expected this.count == ${EXPECTED_COUNT}, but got ${this.count}`);
199- // }
193+ const EXPECTED_COUNT = 70000 ;
194+ const count = doxbee . fakes . Queryish . count ;
195+ if ( count !== EXPECTED_COUNT ) {
196+ throw new Error ( `Expected this.count == ${ EXPECTED_COUNT } , but got ${ count } ` ) ;
197+ }
200198 }
201199} ;
202200
0 commit comments