@onflow/flow-js-testing
Version:
This package will expose a set of utility methods, to allow Cadence code testing with libraries like Jest
21 lines (15 loc) • 463 B
JavaScript
import path from "path"
import {init, emulator, getAccountAddress, isAddress} from "../src"
beforeEach(async () => {
const basePath = path.resolve(__dirname, "./cadence")
await init(basePath)
await emulator.start()
})
test("get account address", async () => {
const Alice = await getAccountAddress("Alice")
// Expect Alice to be address of Alice's account
expect(isAddress(Alice)).toBe(true)
})
afterEach(async () => {
await emulator.stop()
})