mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Skeleton
This commit is contained in:
parent
14bb6899d8
commit
2b0f8d9f0d
6 changed files with 76 additions and 4 deletions
41
test/e2e/teardown-ci.e2e.spec.js
Normal file
41
test/e2e/teardown-ci.e2e.spec.js
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import { describe, it, before, beforeEach, afterEach } from "node:test";
|
||||
import { DockerTestContainer } from "./DockerTestContainer.js";
|
||||
import assert from "node:assert";
|
||||
|
||||
describe("E2E: safe-chain teardown command (CI)", () => {
|
||||
let container;
|
||||
|
||||
before(async () => {
|
||||
DockerTestContainer.buildImage();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
container = new DockerTestContainer();
|
||||
await container.start();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (container) {
|
||||
await container.stop();
|
||||
container = null;
|
||||
}
|
||||
});
|
||||
|
||||
it("safe-chain teardown removes shims directory created by setup-ci", async () => {
|
||||
const shell = await container.openShell("bash");
|
||||
|
||||
// Run setup-ci
|
||||
await shell.runCommand("safe-chain setup-ci");
|
||||
|
||||
// Verify shims directory exists
|
||||
const checkShimsExist = await shell.runCommand("test -d ~/.safe-chain/shims && echo 'exists' || echo 'missing'");
|
||||
assert.ok(checkShimsExist.output.includes("exists"), "Shims directory should exist after setup-ci");
|
||||
|
||||
// Run teardown
|
||||
await shell.runCommand("safe-chain teardown");
|
||||
|
||||
// Verify shims directory is gone
|
||||
const checkShimsGone = await shell.runCommand("test -d ~/.safe-chain/shims && echo 'exists' || echo 'missing'");
|
||||
assert.ok(checkShimsGone.output.includes("missing"), "Shims directory should be removed after teardown");
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue