Skip to content
This repository was archived by the owner on Aug 24, 2023. It is now read-only.

Commit 4d2973e

Browse files
authored
chore(ts-tests): Replace MetaDContainer with MetaChainContainer (#104)
<!-- Thanks for sending a pull request! --> #### What this PR does / why we need it: #### Which issue(s) does this PR fixes?: <!-- (Optional) Automatically closes linked issue when PR is merged. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> Fixes # #### Additional comments?:
1 parent faacc82 commit 4d2973e

File tree

9 files changed

+41
-274
lines changed

9 files changed

+41
-274
lines changed

packages/testcontainers/src/MetaChainContainer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NetworkConfig, TestNet } from '@defimetachain/network';
22
import { ethers } from 'ethers';
3-
import { GenericContainer, StartedTestContainer } from 'testcontainers';
3+
import { GenericContainer, Network, StartedTestContainer } from 'testcontainers';
44
import { AbstractStartedContainer } from 'testcontainers/dist/modules/abstract-started-container';
55

66
export class MetaChainContainer extends GenericContainer {
@@ -36,7 +36,10 @@ export class MetaChainContainer extends GenericContainer {
3636
}
3737

3838
public async start(): Promise<StartedMetaChainContainer> {
39+
const network = await new Network().start();
40+
3941
this.withExposedPorts(...Object.values(this.config.ports))
42+
.withNetworkMode(network.getName())
4043
.withCmd(this.getCmd())
4144
.withStartupTimeout(120_000);
4245

pnpm-lock.yaml

Lines changed: 7 additions & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ts-tests/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"devDependencies": {
1313
"@birthdayresearch/sticky-turbo-jest": "0.2.0",
1414
"@defimetachain/typescript": "workspace:*",
15+
"@defimetachain/testcontainers": "workspace:*",
1516
"@polkadot/api": "^8.8.2",
1617
"ethers": "^5.4.6",
1718
"hardhat": "^2.11.1",

ts-tests/src/containers/MetaDContainer.test.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

ts-tests/src/containers/MetaDContainer.ts

Lines changed: 0 additions & 148 deletions
This file was deleted.

ts-tests/src/containers/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)