Skip to content

Commit 08c2b05

Browse files
committed
Make test pass on windows
1 parent 4d1560a commit 08c2b05

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/hardhat-verify/test/unit/utilities.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ describe("Utilities", () => {
4646
it("should throw if the constructor arguments exported in constructorArgsModule are not an array", async () => {
4747
const constructorArgsModule =
4848
"test/unit/mocks/invalid-constructor-args.js";
49-
const constructorArgsModulePath = path.resolve(
50-
process.cwd(),
51-
constructorArgsModule
52-
);
49+
const constructorArgsModulePath = path
50+
.resolve(process.cwd(), constructorArgsModule)
51+
// make test work on windows
52+
.replace(/\\/g, "\\\\");
5353
await expect(
5454
resolveConstructorArguments([], constructorArgsModule)
5555
).to.be.rejectedWith(
@@ -100,7 +100,11 @@ describe("Utilities", () => {
100100

101101
it("should throw if the libraries exported in librariesModule are not a dictionary", async () => {
102102
const librariesModule = "test/unit/mocks/invalid-libraries.js";
103-
const librariesModulePath = path.resolve(process.cwd(), librariesModule);
103+
const librariesModulePath = path
104+
.resolve(process.cwd(), librariesModule)
105+
// make test work on windows
106+
.replace(/\\/g, "\\\\");
107+
104108
await expect(resolveLibraries(librariesModule)).to.be.rejectedWith(
105109
new RegExp(
106110
`The module ${librariesModulePath} doesn't export a dictionary.`

0 commit comments

Comments
 (0)