@sprucelabs/spruce-heartwood-utils 19.5.12 → 19.6.0

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.
@@ -13,6 +13,7 @@ export default class MockRemoteViewControllerFactory implements RemoteViewContro
13
13
  static reset(): void;
14
14
  static getInstance(): MockRemoteViewControllerFactory;
15
15
  getTheme(_namespace?: string | undefined): undefined;
16
+ assertDidNotFetchRemoteController(id: string): void;
16
17
  assertFetchedRemoteController(id: string, options?: Record<string, any>): void;
17
18
  hasController(name: string): boolean;
18
19
  RemoteController(name: string, options: Record<string, any>): Promise<any>;
@@ -25,6 +25,15 @@ class MockRemoteViewControllerFactory {
25
25
  getTheme(_namespace) {
26
26
  return undefined;
27
27
  }
28
+ assertDidNotFetchRemoteController(id) {
29
+ try {
30
+ this.assertFetchedRemoteController(id);
31
+ }
32
+ catch (_a) {
33
+ return;
34
+ }
35
+ test_utils_1.assert.fail(`You fetched the controller with the id '${id}' but you should not have.`);
36
+ }
28
37
  assertFetchedRemoteController(id, options) {
29
38
  test_utils_1.assert.isTrue(this.hasController(id), `You never tried to fetch a controller with the id '${id}'. Try remoteViews.RemoteController(...)`);
30
39
  if (options) {
@@ -13,6 +13,7 @@ export default class MockRemoteViewControllerFactory implements RemoteViewContro
13
13
  static reset(): void;
14
14
  static getInstance(): MockRemoteViewControllerFactory;
15
15
  getTheme(_namespace?: string | undefined): undefined;
16
+ assertDidNotFetchRemoteController(id: string): void;
16
17
  assertFetchedRemoteController(id: string, options?: Record<string, any>): void;
17
18
  hasController(name: string): boolean;
18
19
  RemoteController(name: string, options: Record<string, any>): Promise<any>;
@@ -32,6 +32,15 @@ export default class MockRemoteViewControllerFactory {
32
32
  getTheme(_namespace) {
33
33
  return undefined;
34
34
  }
35
+ assertDidNotFetchRemoteController(id) {
36
+ try {
37
+ this.assertFetchedRemoteController(id);
38
+ }
39
+ catch (_a) {
40
+ return;
41
+ }
42
+ assert.fail(`You fetched the controller with the id '${id}' but you should not have.`);
43
+ }
35
44
  assertFetchedRemoteController(id, options) {
36
45
  assert.isTrue(this.hasController(id), `You never tried to fetch a controller with the id '${id}'. Try remoteViews.RemoteController(...)`);
37
46
  if (options) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-heartwood-utils",
3
3
  "description": "Heartwood Utilities",
4
- "version": "19.5.12",
4
+ "version": "19.6.0",
5
5
  "skill": {
6
6
  "namespace": "heartwood"
7
7
  },