On this page
1 min read
How to init framework
For Framework to operate properly you need to initialize it first.
You can do it with provided init
method.
Initializes framework variables.
Name | Type | Optional | Description |
---|---|---|---|
basePath | string | path to the folder holding all Cadence template files | |
options | object | ✅ | options object to use during initialization |
Name | Type | Optional | Description |
---|---|---|---|
pkey | ✅ | private key for service account |
1import path from "path"2import {init} from "@onflow/flow-js-testing"34describe("test setup", () => {5beforeEach(async () => {6const basePath = path.resolve(__dirname, "../cadence")7await init(basePath)89// alternatively you can pass specific port10// await init(basePath, {port: 8085})11})12})