@fedify/testing 2.0.0-dev.206 → 2.0.0-dev.211

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mod.cjs CHANGED
@@ -531,11 +531,22 @@ var MockContext = class MockContext {
531
531
  this.contextLoader = options.contextLoader ?? this.documentLoader;
532
532
  this.tracerProvider = options.tracerProvider ?? noopTracerProvider;
533
533
  }
534
- getActor(_handle) {
535
- return Promise.resolve(null);
534
+ async getActor(handle) {
535
+ if (this.federation instanceof MockFederation && this.federation.actorPath) {
536
+ const dispatcher = this.federation.actorDispatchers.get(this.federation.actorPath);
537
+ if (dispatcher) return await dispatcher(this, handle);
538
+ }
539
+ return null;
536
540
  }
537
- getObject(_cls, _values) {
538
- return Promise.resolve(null);
541
+ async getObject(cls, values) {
542
+ if (this.federation instanceof MockFederation) {
543
+ const path = this.federation.objectPaths.get(cls.typeId.href);
544
+ if (path) {
545
+ const dispatcher = this.federation.objectDispatchers.get(path);
546
+ if (dispatcher) return await dispatcher(this, values);
547
+ }
548
+ }
549
+ return null;
539
550
  }
540
551
  getSignedKey() {
541
552
  return Promise.resolve(null);
package/dist/mod.js CHANGED
@@ -508,11 +508,22 @@ var MockContext = class MockContext {
508
508
  this.contextLoader = options.contextLoader ?? this.documentLoader;
509
509
  this.tracerProvider = options.tracerProvider ?? noopTracerProvider;
510
510
  }
511
- getActor(_handle) {
512
- return Promise.resolve(null);
511
+ async getActor(handle) {
512
+ if (this.federation instanceof MockFederation && this.federation.actorPath) {
513
+ const dispatcher = this.federation.actorDispatchers.get(this.federation.actorPath);
514
+ if (dispatcher) return await dispatcher(this, handle);
515
+ }
516
+ return null;
513
517
  }
514
- getObject(_cls, _values) {
515
- return Promise.resolve(null);
518
+ async getObject(cls, values) {
519
+ if (this.federation instanceof MockFederation) {
520
+ const path = this.federation.objectPaths.get(cls.typeId.href);
521
+ if (path) {
522
+ const dispatcher = this.federation.objectDispatchers.get(path);
523
+ if (dispatcher) return await dispatcher(this, values);
524
+ }
525
+ }
526
+ return null;
516
527
  }
517
528
  getSignedKey() {
518
529
  return Promise.resolve(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/testing",
3
- "version": "2.0.0-dev.206+fa815928",
3
+ "version": "2.0.0-dev.211+ec32aaad",
4
4
  "description": "Testing utilities for Fedify applications",
5
5
  "keywords": [
6
6
  "fedify",
@@ -50,7 +50,7 @@
50
50
  "package.json"
51
51
  ],
52
52
  "peerDependencies": {
53
- "@fedify/fedify": "^2.0.0-dev.206+fa815928"
53
+ "@fedify/fedify": "^2.0.0-dev.211+ec32aaad"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@js-temporal/polyfill": "^0.5.1",