create-fhevm-playground-pro 1.0.17 → 1.0.19
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require('@nomicfoundation/hardhat-toolbox');
|
|
2
|
+
require('ts-node/register');
|
|
2
3
|
|
|
3
4
|
const config = {
|
|
4
5
|
solidity: '0.8.24',
|
|
@@ -8,6 +9,9 @@ const config = {
|
|
|
8
9
|
artifacts: './artifacts'
|
|
9
10
|
},
|
|
10
11
|
mocha: {
|
|
12
|
+
require: ['ts-node/register'],
|
|
13
|
+
extensions: ['js'],
|
|
14
|
+
spec: 'test/**/*.test.js',
|
|
11
15
|
timeout: 200000
|
|
12
16
|
}
|
|
13
17
|
};
|
package/dist/scaffolder.js
CHANGED
|
@@ -70,17 +70,22 @@ async function createExample(options) {
|
|
|
70
70
|
console.log(chalk_1.default.cyan(`Overlaid contracts from ${exampleDirName}-premium`));
|
|
71
71
|
}
|
|
72
72
|
if (fs_extra_1.default.existsSync(testSrc)) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
// Copy tests directory content
|
|
74
|
+
const testFiles = fs_extra_1.default.readdirSync(testSrc);
|
|
75
|
+
for (const file of testFiles) {
|
|
76
|
+
const srcPath = path_1.default.join(testSrc, file);
|
|
77
|
+
if (fs_extra_1.default.statSync(srcPath).isFile()) {
|
|
78
|
+
const destPath = path_1.default.join(testDest, file);
|
|
79
|
+
// Convert .ts to .js (rename extension)
|
|
80
|
+
const destFileName = file.endsWith('.ts') ? file.replace('.ts', '.js') : file;
|
|
81
|
+
const finalDestPath = path_1.default.join(testDest, destFileName);
|
|
82
|
+
let content = fs_extra_1.default.readFileSync(srcPath, 'utf-8');
|
|
83
|
+
// Fix import paths in test files
|
|
84
|
+
content = content.replace(/import\s+{([^}]+)}\s+from\s+"\.\.\/\.\.\/\.\.\/\.\.\/scripts\/test-helpers"/, 'import { $1 } from "./test-helpers.js"');
|
|
85
|
+
fs_extra_1.default.writeFileSync(finalDestPath, content);
|
|
86
|
+
}
|
|
83
87
|
}
|
|
88
|
+
console.log(chalk_1.default.cyan(`Overlaid tests from ${exampleDirName}-premium`));
|
|
84
89
|
// Create test-helpers.js stub if it doesn't exist
|
|
85
90
|
const testHelpersPath = path_1.default.join(testDest, 'test-helpers.js');
|
|
86
91
|
if (!fs_extra_1.default.existsSync(testHelpersPath)) {
|