AlgorandFixture
Defined in: src/testing/types.ts:69
An Algorand automated testing fixture
Properties
Section titled “Properties”beforeEach()
Section titled “beforeEach()”beforeEach: () =>
Promise<void>
Defined in: src/testing/types.ts:93
Returns
Section titled “Returns”Promise<void>
newScope()
Section titled “newScope()”newScope: () =>
Promise<void>
Defined in: src/testing/types.ts:133
Creates a new isolated fixture scope (clean transaction logger, AlgorandClient, testAccount, etc.).
You can call this from any testing framework specific hook method to control when you want a new scope.
Returns
Section titled “Returns”Promise<void>
Examples
Section titled “Examples”describe('MY MODULE', () => { const fixture = algorandFixture() beforeEach(fixture.newScope)
test('MY TEST', async () => { const { algorand, testAccount } = fixture.context
// Test stuff! })})describe('MY MODULE', () => { const fixture = algorandFixture() beforeAll(fixture.newScope)
test('test1', async () => { const { algorand, testAccount } = fixture.context
// Test stuff! }) test('test2', async () => { const { algorand, testAccount } = fixture.context // algorand and testAccount are the same as in test1 })})Accessors
Section titled “Accessors”algorand
Section titled “algorand”Get Signature
Section titled “Get Signature”get algorand():
AlgorandClient
Defined in: src/testing/types.ts:87
Retrieve an AlgorandClient loaded with the current context, including testAccount and any generated accounts loaded as signers.
Returns
Section titled “Returns”context
Section titled “context”Get Signature
Section titled “Get Signature”get context():
AlgorandTestAutomationContext
Defined in: src/testing/types.ts:82
Retrieve the current context. Useful with destructuring.
If you haven’t called newScope then this will throw an error.
Example
Section titled “Example”test('My test', () => { const {algod, indexer, testAccount, ...} = fixture.context})