algorandFixture
Call Signature
Section titled “Call Signature”algorandFixture(
fixtureConfig?):AlgorandFixture
Defined in: src/testing/fixtures/algorand-fixture.ts:60
Creates a test fixture for automated testing against Algorand. By default it tests against an environment variable specified client if the standard environment variables are specified, otherwise against a default LocalNet instance, but you can pass in an algod, indexer and/or kmd (or their respective config) if you want to test against an explicitly defined network.
Parameters
Section titled “Parameters”fixtureConfig?
Section titled “fixtureConfig?”The fixture configuration
Returns
Section titled “Returns”The fixture
Examples
Section titled “Examples”const fixture = algorandFixture()
beforeEach(fixture.newScope)
test('My test', async () => { const {algod, indexer, testAccount, ...} = fixture.context // test things...})const fixture = algorandFixture()
beforeAll(fixture.newScope)
test('My test', async () => { const {algod, indexer, testAccount, ...} = fixture.context // test things...})const fixture = algorandFixture({ algod: new AlgodClient({ baseUrl: 'http://localhost:12345', headers: { 'X-Algo-API-Token': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } }), // ...})
beforeEach(fixture.newScope)
test('My test', async () => { const {algod, indexer, testAccount, ...} = fixture.context // test things...})Call Signature
Section titled “Call Signature”algorandFixture(
fixtureConfig,config):AlgorandFixture
Defined in: src/testing/fixtures/algorand-fixture.ts:75
Parameters
Section titled “Parameters”fixtureConfig
Section titled “fixtureConfig”The fixture configuration
AlgorandFixtureConfig | undefined
config
Section titled “config”The fixture configuration
Returns
Section titled “Returns”The fixture