1
1
"use strict" ;
2
2
3
- require ( "should" ) ;
4
3
const path = require ( "path" ) ;
5
4
const fs = require ( "fs" ) ;
6
5
const asyncLib = require ( "async" ) ;
7
- var Test = require ( "mocha/lib/test" ) ;
8
6
9
7
const Benchmark = require ( "benchmark" ) ;
10
8
@@ -24,8 +22,7 @@ describe("BenchmarkTestCases", function() {
24
22
fs . mkdirSync ( baselinesPath ) ;
25
23
} catch ( e ) { }
26
24
27
- before ( function ( done ) {
28
- this . timeout ( 270000 ) ;
25
+ beforeAll ( function ( done ) {
29
26
const git = require ( "simple-git" ) ;
30
27
const rootPath = path . join ( __dirname , ".." ) ;
31
28
getBaselineRevs ( rootPath , ( err , baselineRevisions ) => {
@@ -65,7 +62,7 @@ describe("BenchmarkTestCases", function() {
65
62
}
66
63
} , done ) ;
67
64
} ) ;
68
- } ) ;
65
+ } , 270000 ) ;
69
66
70
67
function getBaselineRevs ( rootPath , callback ) {
71
68
const git = require ( "simple-git" ) ( rootPath ) ;
@@ -169,17 +166,10 @@ describe("BenchmarkTestCases", function() {
169
166
tests . forEach ( testName => {
170
167
const testDirectory = path . join ( casesPath , testName ) ;
171
168
let headStats = null ;
172
- const suite = describe ( testName , function ( ) { } ) ;
173
- it ( `${ testName } create benchmarks` , function ( ) {
169
+ describe ( `${ testName } create benchmarks` , function ( ) {
174
170
baselines . forEach ( baseline => {
175
171
let baselineStats = null ;
176
-
177
- function it ( title , fn ) {
178
- const test = new Test ( title , fn ) ;
179
- suite . addTest ( test ) ;
180
- }
181
172
it ( `should benchmark ${ baseline . name } (${ baseline . rev } )` , function ( done ) {
182
- this . timeout ( 180000 ) ;
183
173
const outputDirectory = path . join ( __dirname , "js" , "benchmark" , `baseline-${ baseline . name } ` , testName ) ;
184
174
const config = Object . create ( require ( path . join ( testDirectory , "webpack.config.js" ) ) ) ;
185
175
config . output = Object . create ( config . output || { } ) ;
@@ -194,7 +184,7 @@ describe("BenchmarkTestCases", function() {
194
184
baselineStats = stats ;
195
185
done ( ) ;
196
186
} ) ;
197
- } ) ;
187
+ } , 180000 ) ;
198
188
199
189
if ( baseline . name !== "HEAD" ) {
200
190
it ( `HEAD should not be slower than ${ baseline . name } (${ baseline . rev } )` , function ( ) {
0 commit comments