@sprucelabs/mercury-chunking-emitter 1.1.4 → 1.2.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.
- package/build/chunkingEmitter/MockChunkingEmitter.d.ts +1 -0
- package/build/chunkingEmitter/MockChunkingEmitter.js +4 -1
- package/build/esm/chunkingEmitter/MockChunkingEmitter.d.ts +1 -0
- package/build/esm/chunkingEmitter/MockChunkingEmitter.js +4 -1
- package/build/esm/index.d.ts +3 -2
- package/build/esm/index.js +2 -0
- package/build/index.d.ts +3 -2
- package/build/index.js +2 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ class MockChunkingEmitter {
|
|
|
9
9
|
MockChunkingEmitter.lastInstance = this;
|
|
10
10
|
}
|
|
11
11
|
static getLastInstance() {
|
|
12
|
-
test_utils_1.assert.isTruthy(this.lastInstance, 'You have not constructed a ChunkingEmitter!
|
|
12
|
+
test_utils_1.assert.isTruthy(this.lastInstance, 'You have not constructed a ChunkingEmitter! Make sure you set ChunkingEmitterImpl.Class = MockChunkingEmitter in your beforeEach() and then ChunkingEmitterImpl.Emitter({}) in your production code somewhere!');
|
|
13
13
|
return this.lastInstance;
|
|
14
14
|
}
|
|
15
15
|
static reset() {
|
|
@@ -50,5 +50,8 @@ class MockChunkingEmitter {
|
|
|
50
50
|
test_utils_1.assert.isTruthy(chunkField, 'Your event does not conform to the chunking signature. Please add a chunk field to your event payload. Add a field to your payload called chunk: chunkFieldDefinition()');
|
|
51
51
|
test_utils_1.assert.isEqualDeep(chunkField, (0, chunkFieldDefinition_1.chunkFieldDefinition)(), 'Your chunk field is there but not properly formed. Use chunkFieldDefinition() to define it.');
|
|
52
52
|
}
|
|
53
|
+
assertDidNotEmit() {
|
|
54
|
+
test_utils_1.assert.isFalse(this.didEmit, `You called chunkingEmitter.emit(...) but you should not have!`);
|
|
55
|
+
}
|
|
53
56
|
}
|
|
54
57
|
exports.default = MockChunkingEmitter;
|
|
@@ -16,7 +16,7 @@ export default class MockChunkingEmitter {
|
|
|
16
16
|
MockChunkingEmitter.lastInstance = this;
|
|
17
17
|
}
|
|
18
18
|
static getLastInstance() {
|
|
19
|
-
assert.isTruthy(this.lastInstance, 'You have not constructed a ChunkingEmitter!
|
|
19
|
+
assert.isTruthy(this.lastInstance, 'You have not constructed a ChunkingEmitter! Make sure you set ChunkingEmitterImpl.Class = MockChunkingEmitter in your beforeEach() and then ChunkingEmitterImpl.Emitter({}) in your production code somewhere!');
|
|
20
20
|
return this.lastInstance;
|
|
21
21
|
}
|
|
22
22
|
static reset() {
|
|
@@ -59,4 +59,7 @@ export default class MockChunkingEmitter {
|
|
|
59
59
|
assert.isTruthy(chunkField, 'Your event does not conform to the chunking signature. Please add a chunk field to your event payload. Add a field to your payload called chunk: chunkFieldDefinition()');
|
|
60
60
|
assert.isEqualDeep(chunkField, chunkFieldDefinition(), 'Your chunk field is there but not properly formed. Use chunkFieldDefinition() to define it.');
|
|
61
61
|
}
|
|
62
|
+
assertDidNotEmit() {
|
|
63
|
+
assert.isFalse(this.didEmit, `You called chunkingEmitter.emit(...) but you should not have!`);
|
|
64
|
+
}
|
|
62
65
|
}
|
package/build/esm/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default
|
|
1
|
+
import { default as ChunkingEmitterImpl } from './chunkingEmitter/ChunkingEmitter';
|
|
2
|
+
export default ChunkingEmitterImpl;
|
|
3
|
+
export { ChunkingEmitter } from './chunkingEmitter/ChunkingEmitter';
|
|
3
4
|
export { default as MockChunkingEmitter } from './chunkingEmitter/MockChunkingEmitter';
|
package/build/esm/index.js
CHANGED
package/build/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default
|
|
1
|
+
import { default as ChunkingEmitterImpl } from './chunkingEmitter/ChunkingEmitter';
|
|
2
|
+
export default ChunkingEmitterImpl;
|
|
3
|
+
export { ChunkingEmitter } from './chunkingEmitter/ChunkingEmitter';
|
|
3
4
|
export { default as MockChunkingEmitter } from './chunkingEmitter/MockChunkingEmitter';
|
package/build/index.js
CHANGED
|
@@ -4,5 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.MockChunkingEmitter = void 0;
|
|
7
|
+
const ChunkingEmitter_1 = __importDefault(require("./chunkingEmitter/ChunkingEmitter"));
|
|
8
|
+
exports.default = ChunkingEmitter_1.default;
|
|
7
9
|
var MockChunkingEmitter_1 = require("./chunkingEmitter/MockChunkingEmitter");
|
|
8
10
|
Object.defineProperty(exports, "MockChunkingEmitter", { enumerable: true, get: function () { return __importDefault(MockChunkingEmitter_1).default; } });
|