Skip to content

Commit

Permalink
chore: implemented a global hook for jest
Browse files Browse the repository at this point in the history
  • Loading branch information
abilevych committed Nov 3, 2023
1 parent ca9e597 commit 6ed2427
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 52 deletions.
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ services:
- DATABASE_PASSWORD=postgres
- DATABASE_NAME=block-explorer
- BLOCKCHAIN_RPC_URL=http://zksync:3050
- BATCHES_PROCESSING_POLLING_INTERVAL=1000
ports:
- '3001:3001'
- '9229:9229'
Expand Down
1 change: 1 addition & 0 deletions packages/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"moduleFileExtensions": ["js", "json", "ts"],
"setupFiles": ["<rootDir>/tests/hooks/global.ts"],
"rootDir": ".",
"testEnvironment": "node",
"testRegex": ".test.ts$",
Expand Down
52 changes: 0 additions & 52 deletions packages/integration-tests/tests/hooks/global.test.ts

This file was deleted.

23 changes: 23 additions & 0 deletions packages/integration-tests/tests/hooks/global.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Buffer } from "../../src/entities";
import { Helper } from "../../src/helper";
import { Playbook } from "../../src/playbook/playbook";

async function globalHook() {
const playbook = new Playbook();
const helper = new Helper();
const bufferRoute = "src/playbook/";
const bufferFile = bufferRoute + Buffer.L1;
const token = await helper.getStringFromFile(bufferFile);

await playbook.deployERC20toL2();
await playbook.deployERC20toL1();
await playbook.depositETH("0.0000001");
await playbook.depositERC20("100", token, 18);
}

globalHook()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});

0 comments on commit 6ed2427

Please sign in to comment.