1
1
import assert from "node:assert/strict" ;
2
2
import { describe , it } from "node:test" ;
3
3
4
+ import { resolveHardhatConfigPath } from "../../../src/config.js" ;
4
5
import { createHardhatRuntimeEnvironment } from "../../../src/hre.js" ;
5
6
import { builtinPlugins } from "../../../src/internal/builtin-plugins/index.js" ;
6
- import { resolveConfigPath } from "../../../src/internal/helpers/config-loading.js" ;
7
7
import {
8
8
getHardhatRuntimeEnvironmentSingleton ,
9
9
resetHardhatRuntimeEnvironmentSingleton ,
@@ -47,13 +47,13 @@ describe("HRE", () => {
47
47
it ( "should return the HARDHAT_CONFIG env variable if it is set" , async ( ) => {
48
48
process . env . HARDHAT_CONFIG = "env.config.js" ;
49
49
50
- assert . equal ( await resolveConfigPath ( ) , "env.config.js" ) ;
50
+ assert . equal ( await resolveHardhatConfigPath ( ) , "env.config.js" ) ;
51
51
52
52
delete process . env . HARDHAT_CONFIG ;
53
53
} ) ;
54
54
55
55
it ( "should throw if the config file is not found" , async ( ) => {
56
- await assert . rejects ( resolveConfigPath ( ) , {
56
+ await assert . rejects ( resolveHardhatConfigPath ( ) , {
57
57
message : "HHE5: No Hardhat config file found" ,
58
58
} ) ;
59
59
} ) ;
@@ -63,7 +63,7 @@ describe("HRE", () => {
63
63
useFixtureProject ( "config-js" ) ;
64
64
65
65
it ( "should load a config file in the current directory" , async ( ) => {
66
- const configPath = await resolveConfigPath ( ) ;
66
+ const configPath = await resolveHardhatConfigPath ( ) ;
67
67
68
68
assert (
69
69
configPath . endsWith ( "hardhat.config.js" ) ,
@@ -76,7 +76,7 @@ describe("HRE", () => {
76
76
useFixtureProject ( "config-js" , "nested-folder" ) ;
77
77
78
78
it ( "should load a config file in the parent directory" , async ( ) => {
79
- const configPath = await resolveConfigPath ( ) ;
79
+ const configPath = await resolveHardhatConfigPath ( ) ;
80
80
81
81
assert (
82
82
configPath . endsWith ( "hardhat.config.js" ) ,
@@ -91,7 +91,7 @@ describe("HRE", () => {
91
91
useFixtureProject ( "config-ts" ) ;
92
92
93
93
it ( "should load a config file in the current directory" , async ( ) => {
94
- const configPath = await resolveConfigPath ( ) ;
94
+ const configPath = await resolveHardhatConfigPath ( ) ;
95
95
96
96
assert (
97
97
configPath . endsWith ( "hardhat.config.ts" ) ,
@@ -104,7 +104,7 @@ describe("HRE", () => {
104
104
useFixtureProject ( "config-ts" , "nested-folder" ) ;
105
105
106
106
it ( "should load a config file in the parent directory" , async ( ) => {
107
- const configPath = await resolveConfigPath ( ) ;
107
+ const configPath = await resolveHardhatConfigPath ( ) ;
108
108
109
109
assert (
110
110
configPath . endsWith ( "hardhat.config.ts" ) ,
0 commit comments