Skip to main content

Init Framework

For Framework to operate properly you need to initialize it first. You can do it with provided init method.

init( basePath, options)​

Initializes framework variables.

Arguments​

NameTypeOptionalDescription
basePathstringpath to the folder holding all Cadence template files
optionsobject✅options object to use during initialization

Options​

NameTypeOptionalDescription
pkey✅private key for service account

Usage​


_12
import path from "path"
_12
import {init} from "@onflow/flow-js-testing"
_12
_12
describe("test setup", () => {
_12
beforeEach(async () => {
_12
const basePath = path.resolve(__dirname, "../cadence")
_12
await init(basePath)
_12
_12
// alternatively you can pass specific port
_12
// await init(basePath, {port: 8085})
_12
})
_12
})