Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 841 Bytes

File metadata and controls

40 lines (32 loc) · 841 Bytes

Node Module

Module for using local ganache node with playwright helpers

Install

yarn add @tester513/wallets-testing-nodes

Usage

Import this module and provide rpcUrl parameter via factory12312321312312

@Module({
    imports: [
        NodeModule.forRoot(
            (configService: ConfigService) => {
                return { rpcUrl: configService.get('RPC_URL') };
            },
            [ConfigService],
            [ConfigModule],
        ),
    ],
})
export class MyModule {}

// Usage
export class MyService {
  constructor(private ethereumNodeService: EthereumNodeService) {}

  async myMethod() {
     await this.ethereumNodeService.startNode();
     const state = await this.ethereumNodeService.state;
     expect(state).toBeDefined()
     await this.ethereumNodeService.stopNode();
  }
}