Skip to content

Commit

Permalink
test: move initialization in before()
Browse files Browse the repository at this point in the history
  • Loading branch information
vp4242 committed Dec 17, 2024
1 parent f5937f9 commit e90216a
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions test/integration/negative-rebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,12 @@ import { Snapshot } from "test/suite";

describe("Negative rebase", () => {
let ctx: ProtocolContext;
let snapshot: string;
let beforeTestSnapshot: string;
let beforeSnapshot: string;
let beforeEachSnapshot: string;
let ethHolder, stEthHolder: HardhatEthersSigner;

before(async () => {
beforeTestSnapshot = await Snapshot.take();
});

after(async () => {
await Snapshot.restore(beforeTestSnapshot);
});

beforeEach(async () => {
beforeSnapshot = await Snapshot.take();
ctx = await getProtocolContext();

[ethHolder, stEthHolder] = await ethers.getSigners();
Expand Down Expand Up @@ -64,11 +57,17 @@ describe("Negative rebase", () => {
excludeVaultsBalances: true,
});
}
});

snapshot = await Snapshot.take();
after(async () => {
await Snapshot.restore(beforeSnapshot);
});

beforeEach(async () => {
beforeEachSnapshot = await Snapshot.take();
});

afterEach(async () => await Snapshot.restore(snapshot));
afterEach(async () => await Snapshot.restore(beforeEachSnapshot));

const exitedValidatorsCount = async () => {
const ids = await ctx.contracts.stakingRouter.getStakingModuleIds();
Expand Down

0 comments on commit e90216a

Please sign in to comment.