@sprucelabs/heartwood-view-controllers 119.1.0 → 119.1.1

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.
@@ -3,6 +3,8 @@ export default class MockAudioController implements AudioController {
3
3
  private status;
4
4
  private volume;
5
5
  private sourceUrl?;
6
+ private static lastController?;
7
+ private static didCallBeforeEach;
6
8
  constructor();
7
9
  setVolume(volume: number): void;
8
10
  getVolume(): Promise<number>;
@@ -16,4 +18,6 @@ export default class MockAudioController implements AudioController {
16
18
  assertIsPaused(): void;
17
19
  assertIsStopped(): void;
18
20
  stop(): void;
21
+ static getLastController(): MockAudioController;
22
+ static beforeEach(): void;
19
23
  }
@@ -8,10 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { assert } from '@sprucelabs/test-utils';
11
- export default class MockAudioController {
11
+ class MockAudioController {
12
12
  constructor() {
13
13
  this.status = 'pending';
14
14
  this.volume = 0;
15
+ assert.isTrue(MockAudioController.didCallBeforeEach, `You must call MockAudioController.beforeEach() in your beforeEach() before working with audio.`);
16
+ MockAudioController.lastController = this;
15
17
  }
16
18
  setVolume(volume) {
17
19
  this.volume = volume;
@@ -53,4 +55,14 @@ export default class MockAudioController {
53
55
  assert.isEqual(this.status, 'playing', "Audio is not playing so you can't stop it.");
54
56
  this.status = 'stopped';
55
57
  }
58
+ static getLastController() {
59
+ assert.isTruthy(this.lastController, `No audio controller created yet. Try 'this.device.AudioController()'`);
60
+ return this.lastController;
61
+ }
62
+ static beforeEach() {
63
+ MockAudioController.didCallBeforeEach = true;
64
+ MockAudioController.lastController = undefined;
65
+ }
56
66
  }
67
+ MockAudioController.didCallBeforeEach = false;
68
+ export default MockAudioController;
@@ -3,6 +3,8 @@ export default class MockAudioController implements AudioController {
3
3
  private status;
4
4
  private volume;
5
5
  private sourceUrl?;
6
+ private static lastController?;
7
+ private static didCallBeforeEach;
6
8
  constructor();
7
9
  setVolume(volume: number): void;
8
10
  getVolume(): Promise<number>;
@@ -16,4 +18,6 @@ export default class MockAudioController implements AudioController {
16
18
  assertIsPaused(): void;
17
19
  assertIsStopped(): void;
18
20
  stop(): void;
21
+ static getLastController(): MockAudioController;
22
+ static beforeEach(): void;
19
23
  }
@@ -5,6 +5,8 @@ class MockAudioController {
5
5
  constructor() {
6
6
  this.status = 'pending';
7
7
  this.volume = 0;
8
+ test_utils_1.assert.isTrue(MockAudioController.didCallBeforeEach, `You must call MockAudioController.beforeEach() in your beforeEach() before working with audio.`);
9
+ MockAudioController.lastController = this;
8
10
  }
9
11
  setVolume(volume) {
10
12
  this.volume = volume;
@@ -44,5 +46,14 @@ class MockAudioController {
44
46
  test_utils_1.assert.isEqual(this.status, 'playing', "Audio is not playing so you can't stop it.");
45
47
  this.status = 'stopped';
46
48
  }
49
+ static getLastController() {
50
+ test_utils_1.assert.isTruthy(this.lastController, `No audio controller created yet. Try 'this.device.AudioController()'`);
51
+ return this.lastController;
52
+ }
53
+ static beforeEach() {
54
+ MockAudioController.didCallBeforeEach = true;
55
+ MockAudioController.lastController = undefined;
56
+ }
47
57
  }
58
+ MockAudioController.didCallBeforeEach = false;
48
59
  exports.default = MockAudioController;
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "sideEffects": false,
14
14
  "license": "MIT",
15
15
  "description": "All the power of Heartwood in one, convenient package.",
16
- "version": "119.1.0",
16
+ "version": "119.1.1",
17
17
  "skill": {
18
18
  "namespace": "HeartwoodViewControllers",
19
19
  "commandOverrides": {