@sprucelabs/spruce-invite-utils 3.3.1 → 3.3.2

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.
@@ -1,7 +1,9 @@
1
1
  export default class LoginAndConfirmTestFixture {
2
2
  private static hitCount;
3
+ private static wasBeforeEachCalled;
3
4
  static beforeEach(): void;
4
5
  static getHitCount(): number;
6
+ private static assertBeforeEachWasCalled;
5
7
  static setResponse(r: boolean): void;
6
8
  private static setClass;
7
9
  }
@@ -3,16 +3,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const test_1 = require("@sprucelabs/test");
6
7
  const LoginAndConfirmJoinController_1 = __importDefault(require("../../loggingInAndConfirmingJoin/LoginAndConfirmJoinController"));
7
8
  class LoginAndConfirmTestFixture {
8
9
  static beforeEach() {
9
10
  this.setClass(CountingLoginAndConfirmController);
10
11
  this.hitCount = 0;
12
+ this.wasBeforeEachCalled = true;
11
13
  }
12
14
  static getHitCount() {
15
+ this.assertBeforeEachWasCalled();
13
16
  return this.hitCount;
14
17
  }
18
+ static assertBeforeEachWasCalled() {
19
+ test_1.assert.isTrue(this.wasBeforeEachCalled, `Make sure you call 'LoginAndConfirmTestFixture.beforeEach()' in your test!`);
20
+ }
15
21
  static setResponse(r) {
22
+ this.assertBeforeEachWasCalled();
16
23
  const Class = r
17
24
  ? PassingLoginAndConfirmController
18
25
  : FailingLoginAndConfirmController;
@@ -24,6 +31,7 @@ class LoginAndConfirmTestFixture {
24
31
  }
25
32
  exports.default = LoginAndConfirmTestFixture;
26
33
  LoginAndConfirmTestFixture.hitCount = 0;
34
+ LoginAndConfirmTestFixture.wasBeforeEachCalled = false;
27
35
  class CountingLoginAndConfirmController {
28
36
  async promptForLoginAndConfirmJoin() {
29
37
  //@ts-ignore
@@ -1,7 +1,9 @@
1
1
  export default class LoginAndConfirmTestFixture {
2
2
  private static hitCount;
3
+ private static wasBeforeEachCalled;
3
4
  static beforeEach(): void;
4
5
  static getHitCount(): number;
6
+ private static assertBeforeEachWasCalled;
5
7
  static setResponse(r: boolean): void;
6
8
  private static setClass;
7
9
  }
@@ -7,16 +7,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ import { assert } from '@sprucelabs/test';
10
11
  import LoginAndConfirmJoinControllerImpl from '../../loggingInAndConfirmingJoin/LoginAndConfirmJoinController.js';
11
12
  export default class LoginAndConfirmTestFixture {
12
13
  static beforeEach() {
13
14
  this.setClass(CountingLoginAndConfirmController);
14
15
  this.hitCount = 0;
16
+ this.wasBeforeEachCalled = true;
15
17
  }
16
18
  static getHitCount() {
19
+ this.assertBeforeEachWasCalled();
17
20
  return this.hitCount;
18
21
  }
22
+ static assertBeforeEachWasCalled() {
23
+ assert.isTrue(this.wasBeforeEachCalled, `Make sure you call 'LoginAndConfirmTestFixture.beforeEach()' in your test!`);
24
+ }
19
25
  static setResponse(r) {
26
+ this.assertBeforeEachWasCalled();
20
27
  const Class = r
21
28
  ? PassingLoginAndConfirmController
22
29
  : FailingLoginAndConfirmController;
@@ -27,6 +34,7 @@ export default class LoginAndConfirmTestFixture {
27
34
  }
28
35
  }
29
36
  LoginAndConfirmTestFixture.hitCount = 0;
37
+ LoginAndConfirmTestFixture.wasBeforeEachCalled = false;
30
38
  class CountingLoginAndConfirmController {
31
39
  promptForLoginAndConfirmJoin() {
32
40
  return __awaiter(this, void 0, void 0, function* () {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-invite-utils",
3
3
  "description": "Invite Utilities",
4
- "version": "3.3.1",
4
+ "version": "3.3.2",
5
5
  "skill": {
6
6
  "namespace": "invite"
7
7
  },