-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #816 from SebastienGllmt/writeLocalhostDeployment-…
…flag feat: add `writeLocalhostDeployment` option
- Loading branch information
Showing
2 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { assert } from "chai"; | ||
import { pathExists, removeSync } from "fs-extra"; | ||
import path from "path"; | ||
|
||
import { useEphemeralIgnitionProject } from "../test-helpers/use-ignition-project"; | ||
|
||
const fixtureProjectName = "minimal"; | ||
const deploymentDir = path.join( | ||
path.resolve(__dirname, `../fixture-projects/${fixtureProjectName}/ignition`), | ||
"deployments", | ||
"chain-31337" | ||
); | ||
|
||
describe("localhost deployment flag", function () { | ||
useEphemeralIgnitionProject(fixtureProjectName); | ||
|
||
beforeEach("clean filesystem", async function () { | ||
// make sure nothing is left over from a previous test | ||
removeSync(deploymentDir); | ||
}); | ||
afterEach("clean filesystem", function () { | ||
// cleanup | ||
removeSync(deploymentDir); | ||
}); | ||
|
||
it("true should write deployment to disk", async function () { | ||
await this.hre.run( | ||
{ scope: "ignition", task: "deploy" }, | ||
{ | ||
modulePath: "./ignition/modules/OwnModule.js", | ||
writeLocalhostDeployment: true, | ||
} | ||
); | ||
|
||
assert( | ||
await pathExists(deploymentDir), | ||
"Deployment was not written to disk" | ||
); | ||
}); | ||
|
||
it("false should not write deployment to disk", async function () { | ||
await this.hre.run( | ||
{ scope: "ignition", task: "deploy" }, | ||
{ | ||
modulePath: "./ignition/modules/OwnModule.js", | ||
writeLocalhostDeployment: false, | ||
} | ||
); | ||
|
||
assert( | ||
!(await pathExists(deploymentDir)), | ||
"Deployment was not written to disk" | ||
); | ||
}); | ||
}); |