@@ -22,18 +22,22 @@ import { Ed25519KeyIdentity } from '@dfinity/identity';
2222 *
2323 * @example
2424 * ```ts
25- * import { PocketIc, createIdentity } from '@hadronous/pic';
25+ * import { PocketIc, PocketIcServer, createIdentity } from '@hadronous/pic';
2626 * import { AnonymousIdentity } from '@dfinity/agent';
2727 * import { _SERVICE, idlFactory } from '../declarations';
2828 *
2929 * const wasmPath = resolve('..', '..', 'canister.wasm');
3030 *
31- * const pic = await PocketIc.create();
31+ * const picServer = await PocketIcServer.create();
32+ * const pic = await PocketIc.create(picServer.getUrl());
3233 * const fixture = await pic.setupCanister<_SERVICE>(idlFactory, wasmPath);
3334 * const { actor } = fixture;
3435 *
3536 * const bob = createIdentity('SuperSecretSeedPhraseForBob');
3637 * actor.setIdentity(bob);
38+ *
39+ * await pic.tearDown();
40+ * await picServer.stop();
3741 * ```
3842 */
3943export function createIdentity ( seedPhrase : string ) : Identity {
@@ -67,18 +71,22 @@ function generateMnemonic(): string {
6771 *
6872 * @example
6973 * ```ts
70- * import { PocketIc, generateRandomIdentity } from '@hadronous/pic';
74+ * import { PocketIc, PocketIcServer, generateRandomIdentity } from '@hadronous/pic';
7175 * import { AnonymousIdentity } from '@dfinity/agent';
7276 * import { _SERVICE, idlFactory } from '../declarations';
7377 *
7478 * const wasmPath = resolve('..', '..', 'canister.wasm');
7579 *
76- * const pic = await PocketIc.create();
80+ * const picServer = await PocketIcServer.create();
81+ * const pic = await PocketIc.create(picServer.getUrl());
7782 * const fixture = await pic.setupCanister<_SERVICE>(idlFactory, wasmPath);
7883 * const { actor } = fixture;
7984 *
8085 * const bob = generateRandomIdentity();
8186 * actor.setIdentity(bob);
87+ *
88+ * await pic.tearDown();
89+ * await picServer.stop();
8290 * ```
8391 */
8492export function generateRandomIdentity ( ) : Identity {
0 commit comments