Skip to content
IC Reactor

FakeReplica

Defined in: core/src/testing/fake-replica.ts:115

A fake replica installed by installFakeReplica.

readonly host: string

Defined in: core/src/testing/fake-replica.ts:117

The origin the fake answers for.


readonly rootKey: Uint8Array

Defined in: core/src/testing/fake-replica.ts:123

The DER-encoded root key the fake signs certificates with. An agent on a local host fetches it from the fake; pass it as agentOptions.rootKey to an agent that does not fetch its root key.


readonly requests: readonly FakeReplicaRequest[]

Defined in: core/src/testing/fake-replica.ts:125

Every request an agent sent to the fake, in order.

restore(): void

Defined in: core/src/testing/fake-replica.ts:133

Takes the fake out of globalThis.fetch, putting back the fetch it replaced, along with any wrapper a test installed around it since. Calling it again does nothing, and several fakes may be restored in any order: one installed over this fake keeps its place. An agent built while the fake was installed keeps calling it.

void