Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
boufni95 committed Apr 25, 2024
1 parent f833f2c commit 755f353
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tests/bitcoinCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ export class BitcoinCoreWrapper {
timeout: 5 * 60 * 1000,
})
}

InitAddress = async () => {
this.addr = await this.core.getNewAddress()
}
Init = async () => {
const wallet = await this.core.createWallet('');
console.log({ wallet })
this.addr = await this.core.getNewAddress()
await this.InitAddress()
console.log({ addr: this.addr })
await this.Mine(101)
const info = await this.core.getWalletInfo();
Expand Down
7 changes: 7 additions & 0 deletions src/tests/testRunner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { globby } from 'globby'
import { LoadTestSettingsFromEnv } from '../services/main/settings.js'
import { BitcoinCoreWrapper } from './bitcoinCore.js'
import { setupNetwork } from './networkSetup.js'
import { Describe, SetupTest, teardown, TestBase } from './testBase.js'

Expand All @@ -22,6 +24,11 @@ const getDescribe = (fileName: string): Describe => {
const start = async () => {
if (process.argv[2] === 'setup_network') {
await setupNetwork()
} else {
const core = new BitcoinCoreWrapper(LoadTestSettingsFromEnv())
await core.InitAddress()
await core.Mine(1)
await new Promise((resolve) => setTimeout(resolve, 1000))
}
const files = await globby(["**/*.spec.js", "!**/node_modules/**"])
const modules: { file: string, module: TestModule }[] = []
Expand Down

0 comments on commit 755f353

Please sign in to comment.