File tree 5 files changed +149
-30
lines changed
crates/tools/js/benchmark
hardhat-tests/integration/smock
5 files changed +149
-30
lines changed Original file line number Diff line number Diff line change 58
58
- name : Install package
59
59
run : pnpm install --frozen-lockfile --prefer-offline
60
60
61
+ - name : Run benchmark tests
62
+ run : pnpm test
63
+
61
64
- name : Run benchmark
62
65
run : pnpm run -s benchmark
63
66
Original file line number Diff line number Diff line change 9
9
"prebenchmark" : " cd ../../../edr_napi/ && pnpm build" ,
10
10
"verify" : " node index.js verify" ,
11
11
"report" : " node index.js report" ,
12
+ "test" : " mocha --recursive \" test/**/*.js\" " ,
12
13
"help" : " node index.js -h"
13
14
},
14
15
"keywords" : [],
15
16
"author" : " " ,
16
17
"license" : " ISC" ,
17
18
"devDependencies" : {
18
19
"argparse" : " ^2.0.1" ,
20
+ "chai" : " ^4.2.0" ,
19
21
"hardhat" : " 2.22.5" ,
20
22
"lodash" : " ^4.17.11" ,
23
+ "mocha" : " ^10.0.0" ,
21
24
"tsx" : " ^4.7.1"
22
25
}
23
26
}
Original file line number Diff line number Diff line change
1
+ const { assert } = require ( "chai" ) ;
2
+ const path = require ( "path" ) ;
3
+
4
+ // The benchmarks assume that the EDR version used by
5
+ // Hardhat is the one in the workspace, instead of the one installed
6
+ // from npm. This test checks that this is the case.
7
+ it ( "uses the workspace version of EDR" , async function ( ) {
8
+ const hardhatPath = require . resolve ( "hardhat" ) ;
9
+
10
+ const edrPath = require . resolve ( "@nomicfoundation/edr" , {
11
+ paths : [ hardhatPath ] ,
12
+ } ) ;
13
+
14
+ const expectedPath = path . resolve (
15
+ __dirname ,
16
+ ".." ,
17
+ ".." ,
18
+ ".." ,
19
+ ".." ,
20
+ ".." ,
21
+ "crates" ,
22
+ "edr_napi" ,
23
+ "index.js" ,
24
+ ) ;
25
+
26
+ assert . equal ( edrPath , expectedPath ) ;
27
+ } ) ;
Original file line number Diff line number Diff line change 11
11
"@defi-wonderland/smock" : " ^2.4.0" ,
12
12
"@nomiclabs/hardhat-ethers" : " ^2.2.3" ,
13
13
"chai" : " ^4.3.6" ,
14
+ "ethers" : " 5" ,
14
15
"hardhat" : " 2.22.5" ,
15
16
"mocha" : " ^10.0.0"
16
17
}
You can’t perform that action at this time.
0 commit comments