Skip to content

Commit 755a500

Browse files
committed
move tests into test/src directory
1 parent 4ae9d39 commit 755a500

File tree

11 files changed

+18
-19
lines changed

11 files changed

+18
-19
lines changed

v-next/hardhat/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"lint:fix": "pnpm prettier --write && pnpm eslint --fix",
3636
"eslint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
3737
"prettier": "prettier \"**/*.{ts,js,md,json}\"",
38-
"test": "node --import tsx/esm --test --test-reporter=@nomicfoundation/hardhat-node-test-reporter \"test/**/*.ts\"",
39-
"test:only": "node --import tsx/esm --test --test-only --test-reporter=@nomicfoundation/hardhat-node-test-reporter \"test/**/*.ts\"",
38+
"test": "node --import tsx/esm --test --test-reporter=@nomicfoundation/hardhat-node-test-reporter \"test/src/**/*.ts\"",
39+
"test:only": "node --import tsx/esm --test --test-only --test-reporter=@nomicfoundation/hardhat-node-test-reporter \"test/src/**/*.ts\"",
4040
"pretest": "pnpm build",
4141
"build": "tsc --build .",
4242
"prepublishOnly": "pnpm build",

v-next/hardhat/test/helpers/project.ts

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ async function getFixtureProjectPath(
4343
}
4444

4545
if (!(await exists(projectPath))) {
46-
console.log("projectPath", projectPath);
4746
throw new Error(`Fixture project ${projectName} doesn't exist`);
4847
}
4948

v-next/hardhat/test/hre/index.ts v-next/hardhat/test/src/hre/index.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import assert from "node:assert/strict";
22
import { describe, it } from "node:test";
33

4-
import { createHardhatRuntimeEnvironment } from "../../src/hre.js";
5-
import { builtinPlugins } from "../../src/internal/builtin-plugins/index.js";
6-
import { resolveConfigPath } from "../../src/internal/helpers/config-loading.js";
4+
import { createHardhatRuntimeEnvironment } from "../../../src/hre.js";
5+
import { builtinPlugins } from "../../../src/internal/builtin-plugins/index.js";
6+
import { resolveConfigPath } from "../../../src/internal/helpers/config-loading.js";
77
import {
88
getHardhatRuntimeEnvironmentSingleton,
99
resetHardhatRuntimeEnvironmentSingleton,
10-
} from "../../src/internal/hre-singleton.js";
11-
import { useFixtureProject } from "../helpers/project.js";
10+
} from "../../../src/internal/hre-singleton.js";
11+
import { useFixtureProject } from "../../helpers/project.js";
1212

1313
describe("HRE", () => {
1414
describe("createHardhatRuntimeEnvironment", () => {
@@ -119,7 +119,7 @@ describe("HRE", () => {
119119
useFixtureProject("loaded-config");
120120

121121
it("should load the config file", async () => {
122-
const hre = await import("../../src/index.js");
122+
const hre = await import("../../../src/index.js");
123123

124124
assert.deepEqual(hre.config.plugins, [{ id: "test-plugin" }]);
125125

v-next/hardhat/test/internal/builtin-plugins/run/runScriptWIthHardhat.ts v-next/hardhat/test/src/internal/builtin-plugins/run/runScriptWIthHardhat.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { before, describe, it } from "node:test";
66
import { createHardhatRuntimeEnvironment } from "@nomicfoundation/hardhat-core";
77
import { HardhatError } from "@nomicfoundation/hardhat-errors";
88

9-
import { runScriptWithHardhat } from "../../../../src/internal/builtin-plugins/run/runScriptWithHardhat.js";
10-
import { useFixtureProject } from "../../../helpers/project.js";
9+
import { runScriptWithHardhat } from "../../../../../src/internal/builtin-plugins/run/runScriptWithHardhat.js";
10+
import { useFixtureProject } from "../../../../helpers/project.js";
1111

1212
describe("runScriptWithHardhat", function () {
1313
let hre: HardhatRuntimeEnvironment;

v-next/hardhat/test/internal/cli/helpers/getGlobalHelpString.ts v-next/hardhat/test/src/internal/cli/helpers/getGlobalHelpString.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import type { Task } from "@nomicfoundation/hardhat-core/types/tasks";
33
import assert from "node:assert/strict";
44
import { describe, it } from "node:test";
55

6-
import packageJson from "../../../../package.json";
7-
import { getGlobalHelpString } from "../../../../src/internal/cli/helpers/getGlobalHelpString.js";
6+
import packageJson from "../../../../../package.json";
7+
import { getGlobalHelpString } from "../../../../../src/internal/cli/helpers/getGlobalHelpString.js";
88

99
describe("getGlobalHelpString", function () {
1010
describe("when there are no tasks", function () {

v-next/hardhat/test/internal/cli/helpers/getHelpString.ts v-next/hardhat/test/src/internal/cli/helpers/getHelpString.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { describe, it } from "node:test";
66
import { ParameterType } from "@nomicfoundation/hardhat-core/config";
77
import chalk from "chalk";
88

9-
import { getHelpString } from "../../../../src/internal/cli/helpers/getHelpString.js";
9+
import { getHelpString } from "../../../../../src/internal/cli/helpers/getHelpString.js";
1010

1111
describe("getHelpString", function () {
1212
describe("when the task is empty", function () {

v-next/hardhat/test/internal/cli/helpers/utils.ts v-next/hardhat/test/src/internal/cli/helpers/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
getLongestNameLength,
1414
getSection,
1515
getUsageString,
16-
} from "../../../../src/internal/cli/helpers/utils.js";
16+
} from "../../../../../src/internal/cli/helpers/utils.js";
1717

1818
describe("utils", function () {
1919
describe("parseTasks", function () {

v-next/hardhat/test/internal/cli/main.ts v-next/hardhat/test/src/internal/cli/main.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ import {
3131
parseHardhatSpecialArguments,
3232
parseTask,
3333
parseTaskArguments,
34-
} from "../../../src/internal/cli/main.js";
35-
import { resetHardhatRuntimeEnvironmentSingleton } from "../../../src/internal/hre-singleton.js";
36-
import { getHardhatVersion } from "../../../src/internal/utils/package.js";
37-
import { useFixtureProject } from "../../helpers/project.js";
34+
} from "../../../../src/internal/cli/main.js";
35+
import { resetHardhatRuntimeEnvironmentSingleton } from "../../../../src/internal/hre-singleton.js";
36+
import { getHardhatVersion } from "../../../../src/internal/utils/package.js";
37+
import { useFixtureProject } from "../../../helpers/project.js";
3838

3939
async function getTasksAndHreEnvironment(
4040
tasksBuilders: NewTaskDefinitionBuilder[],

0 commit comments

Comments
 (0)