create-fhevm-playground-pro 1.0.22 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,9 +9,9 @@ const config = {
|
|
|
9
9
|
artifacts: './artifacts'
|
|
10
10
|
},
|
|
11
11
|
mocha: {
|
|
12
|
-
|
|
12
|
+
extensions: ['ts', 'js'],
|
|
13
13
|
spec: 'test/**/*.test.{ts,js}',
|
|
14
|
-
require: 'ts-node/register',
|
|
14
|
+
require: ['ts-node/register'],
|
|
15
15
|
timeout: 200000,
|
|
16
16
|
reporter: 'spec'
|
|
17
17
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"description": "Base template for fhEVM example projects",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"test": "hardhat test",
|
|
6
|
+
"test": "hardhat compile && mocha --require ts-node/register --require hardhat/register 'test/**/*.test.ts'",
|
|
7
7
|
"compile": "hardhat compile"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
package/dist/scaffolder.js
CHANGED
|
@@ -79,6 +79,11 @@ async function createExample(options) {
|
|
|
79
79
|
let testContent = fs_extra_1.default.readFileSync(testPath, 'utf-8');
|
|
80
80
|
// Replace absolute paths: ../../../../scripts/test-helpers -> ./test-helpers.js
|
|
81
81
|
testContent = testContent.replace(/import\s+{([^}]+)}\s+from\s+"\.\.\/\.\.\/\.\.\/\.\.\/scripts\/test-helpers"/, 'import { $1 } from "./test-helpers.js"');
|
|
82
|
+
// Replace hardhat import to work around ESM/CommonJS issues
|
|
83
|
+
// Change: import { ethers } from "hardhat"
|
|
84
|
+
// To: const { ethers } = await import("hardhat")
|
|
85
|
+
// Actually, just remove the import and use globals injected by Hardhat
|
|
86
|
+
testContent = testContent.replace(/import\s*{\s*ethers\s*}\s*from\s*["']hardhat["']\s*;?\n/g, '');
|
|
82
87
|
fs_extra_1.default.writeFileSync(testPath, testContent);
|
|
83
88
|
}
|
|
84
89
|
// Create test-helpers.js stub if it doesn't exist
|