Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2369a9f

Browse files
committed
Fix Windows ENOENT in TypeChain compile tests and update dependencies
Signed-off-by: Angelina <aceppaluni@gmail.com>
1 parent034cbb4 commit2369a9f

File tree

4 files changed

+59
-2
lines changed

4 files changed

+59
-2
lines changed

‎pnpm-lock.yaml‎

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎v-next/hardhat-typechain/package.json‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@
4747
"devDependencies": {
4848
"@nomicfoundation/hardhat-node-test-reporter":"workspace:^3.0.0",
4949
"@nomicfoundation/hardhat-test-utils":"workspace:^",
50+
"@types/chai":"^4.3.20",
5051
"@types/debug":"^4.1.7",
52+
"@types/mocha":"^10.0.10",
5153
"@types/node":"^20.14.9",
5254
"c8":"^9.1.0",
55+
"chai":"^5.3.3",
56+
"cross-spawn":"^7.0.6",
5357
"eslint":"9.25.1",
5458
"expect-type":"^1.2.1",
5559
"prettier":"3.2.5",
@@ -67,8 +71,8 @@
6771
"zod":"^3.23.8"
6872
},
6973
"peerDependencies": {
70-
"hardhat":"workspace:^3.0.0",
7174
"@nomicfoundation/hardhat-ethers":"workspace:^4.0.0",
72-
"ethers":"^6.14.0"
75+
"ethers":"^6.14.0",
76+
"hardhat":"workspace:^3.0.0"
7377
}
7478
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
importpathfrom"path";
2+
importfsfrom"fs";
3+
import{execSync}from"child_process";
4+
import{expect}from"chai";
5+
import{fileURLToPath}from"url";
6+
import{describe,it}from"node:test";
7+
import{after,afterEach,beforeEach}from"node:test";
8+
9+
const__filename=fileURLToPath(import.meta.url);
10+
const__dirname=path.dirname(__filename);
11+
12+
describe("TypeChain compile scenarios",function(){
13+
constfixturesDir=path.join(__dirname,"fixture-projects","generate-types");
14+
consttypechainDir=path.join(fixturesDir,"types");
15+
16+
beforeEach(()=>{
17+
if(fs.existsSync(typechainDir)){
18+
fs.rmSync(typechainDir,{recursive:true,force:true});
19+
}
20+
});
21+
22+
it("should compile all contracts and generate TypeChain files",function(){
23+
try{
24+
execSync("npx hardhat compile",{
25+
cwd:fixturesDir,
26+
stdio:"inherit",
27+
shell:trueasany,// needed on Windows
28+
});
29+
}catch(err:any){
30+
console.error("Hardhat compile failed:",err);
31+
throwerr;
32+
}
33+
34+
// Assert TypeChain files exist
35+
expect(fs.existsSync(typechainDir),"typechain-types folder missing").to.equal(true);
36+
constgeneratedFiles=fs.readdirSync(typechainDir);
37+
expect(generatedFiles.length,"No TypeChain files generated").to.be.greaterThan(0);
38+
});
39+
});
40+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module"cross-spawn";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp