@@ -23,12 +23,12 @@ const bench = common.createBenchmark(main, {
2323 flags : [ '--test-reporter=./benchmark/fixtures/empty-test-reporter.js' ] ,
2424} ) ;
2525
26+ const noop = ( ) => { } ;
27+
2628const allTests = {
27- 'none' : ( loopAmount , avoidV8Optimization ) => {
29+ 'none' : ( loopAmount ) => {
2830 for ( let i = 0 ; i < loopAmount ; i ++ ) {
29- it ( `${ i } ` , ( ) => {
30- avoidV8Optimization = i ;
31- } ) ;
31+ it ( `${ i } ` , noop ) ;
3232 }
3333
3434 return finished ( reporter ) ;
@@ -51,58 +51,50 @@ const allTests = {
5151
5252 return finished ( reporter ) ;
5353 } ,
54- 'skip-method' : ( loopAmount , avoidV8Optimization ) => {
54+ 'skip-method' : ( loopAmount ) => {
5555 for ( let i = 0 ; i < loopAmount ; i ++ ) {
5656 it ( `${ i } ` , ( t ) => {
57- avoidV8Optimization = i ;
5857 t . skip ( ) ;
5958 } ) ;
6059 }
6160
6261 return finished ( reporter ) ;
6362 } ,
64- 'skip-method-with-message' : ( loopAmount , avoidV8Optimization ) => {
63+ 'skip-method-with-message' : ( loopAmount ) => {
6564 for ( let i = 0 ; i < loopAmount ; i ++ ) {
6665 it ( `${ i } ` , ( t ) => {
67- avoidV8Optimization = i ;
6866 t . skip ( 'skip reason' ) ;
6967 } ) ;
7068 }
7169
7270 return finished ( reporter ) ;
7371 } ,
74- 'todo' : ( loopAmount , avoidV8Optimization ) => {
72+ 'todo' : ( loopAmount ) => {
7573 for ( let i = 0 ; i < loopAmount ; i ++ ) {
76- it ( `${ i } ` , { todo : true } , ( ) => {
77- avoidV8Optimization = i ;
78- } ) ;
74+ it ( `${ i } ` , { todo : true } , noop ) ;
7975 }
8076
8177 return finished ( reporter ) ;
8278 } ,
83- 'todo-with-message' : ( loopAmount , avoidV8Optimization ) => {
79+ 'todo-with-message' : ( loopAmount ) => {
8480 for ( let i = 0 ; i < loopAmount ; i ++ ) {
85- it ( `${ i } ` , { todo : 'todo reason' } , ( ) => {
86- avoidV8Optimization = i ;
87- } ) ;
81+ it ( `${ i } ` , { todo : 'todo reason' } , noop ) ;
8882 }
8983
9084 return finished ( reporter ) ;
9185 } ,
92- 'todo-method' : ( loopAmount , avoidV8Optimization ) => {
86+ 'todo-method' : ( loopAmount ) => {
9387 for ( let i = 0 ; i < loopAmount ; i ++ ) {
9488 it ( `${ i } ` , ( t ) => {
95- avoidV8Optimization = i ;
9689 t . todo ( ) ;
9790 } ) ;
9891 }
9992
10093 return finished ( reporter ) ;
10194 } ,
102- 'todo-method-with-message' : ( loopAmount , avoidV8Optimization ) => {
95+ 'todo-method-with-message' : ( loopAmount ) => {
10396 for ( let i = 0 ; i < loopAmount ; i ++ ) {
10497 it ( `${ i } ` , ( t ) => {
105- avoidV8Optimization = i ;
10698 t . todo ( 'todo reason' ) ;
10799 } ) ;
108100 }
@@ -112,13 +104,11 @@ const allTests = {
112104} ;
113105
114106function main ( { n, option } ) {
115- // eslint-disable-next-line prefer-const
116- let avoidV8Optimization = 0 ;
117107 const runOption = allTests [ option ] ;
118108
119109 bench . start ( ) ;
120110
121- runOption ( n , avoidV8Optimization ) . then ( ( ) => {
111+ runOption ( n ) . then ( ( ) => {
122112 bench . end ( n ) ;
123113 } ) ;
124114}
0 commit comments