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

Commit

Permalink
chore(ts-tests): Replace MetaDContainer with MetaChainContainer (#104)
Browse files Browse the repository at this point in the history
<!--  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?:
  • Loading branch information
canonbrother authored Sep 27, 2022
1 parent faacc82 commit 4d2973e
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 274 deletions.
5 changes: 4 additions & 1 deletion packages/testcontainers/src/MetaChainContainer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NetworkConfig, TestNet } from '@defimetachain/network';
import { ethers } from 'ethers';
import { GenericContainer, StartedTestContainer } from 'testcontainers';
import { GenericContainer, Network, StartedTestContainer } from 'testcontainers';
import { AbstractStartedContainer } from 'testcontainers/dist/modules/abstract-started-container';

export class MetaChainContainer extends GenericContainer {
Expand Down Expand Up @@ -36,7 +36,10 @@ export class MetaChainContainer extends GenericContainer {
}

public async start(): Promise<StartedMetaChainContainer> {
const network = await new Network().start();

this.withExposedPorts(...Object.values(this.config.ports))
.withNetworkMode(network.getName())
.withCmd(this.getCmd())
.withStartupTimeout(120_000);

Expand Down
80 changes: 7 additions & 73 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ts-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"devDependencies": {
"@birthdayresearch/sticky-turbo-jest": "0.2.0",
"@defimetachain/typescript": "workspace:*",
"@defimetachain/testcontainers": "workspace:*",
"@polkadot/api": "^8.8.2",
"ethers": "^5.4.6",
"hardhat": "^2.11.1",
Expand Down
28 changes: 0 additions & 28 deletions ts-tests/src/containers/MetaDContainer.test.ts

This file was deleted.

148 changes: 0 additions & 148 deletions ts-tests/src/containers/MetaDContainer.ts

This file was deleted.

1 change: 0 additions & 1 deletion ts-tests/src/containers/index.ts

This file was deleted.

Loading

0 comments on commit 4d2973e

Please sign in to comment.