@toa.io/userland 1.0.0-alpha.15 → 1.0.0-alpha.17
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/userland",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.17",
|
|
4
4
|
"description": "Toa development kit",
|
|
5
5
|
"homepage": "https://toa.io",
|
|
6
6
|
"author": {
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"main": "src/index.js",
|
|
25
25
|
"types": "types/index.d.ts",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@toa.io/boot": "1.0.0-alpha.
|
|
28
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
29
|
-
"@toa.io/filesystem": "1.0.0-alpha.
|
|
30
|
-
"@toa.io/generic": "1.0.0-alpha.
|
|
31
|
-
"@toa.io/norm": "1.0.0-alpha.
|
|
32
|
-
"@toa.io/schemas": "1.0.0-alpha.
|
|
27
|
+
"@toa.io/boot": "1.0.0-alpha.17",
|
|
28
|
+
"@toa.io/core": "1.0.0-alpha.17",
|
|
29
|
+
"@toa.io/filesystem": "1.0.0-alpha.17",
|
|
30
|
+
"@toa.io/generic": "1.0.0-alpha.17",
|
|
31
|
+
"@toa.io/norm": "1.0.0-alpha.17",
|
|
32
|
+
"@toa.io/schemas": "1.0.0-alpha.17",
|
|
33
33
|
"@toa.io/storages.null": "0.22.0",
|
|
34
|
-
"@toa.io/yaml": "1.0.0-alpha.
|
|
34
|
+
"@toa.io/yaml": "1.0.0-alpha.17",
|
|
35
35
|
"tap": "16.3.4"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "40ea6c9695dc6b8dc434cad4eb413d7477238ac5"
|
|
38
38
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const { generate } = require('randomstring')
|
|
4
|
-
const {
|
|
4
|
+
const {
|
|
5
|
+
Locator,
|
|
6
|
+
Connector
|
|
7
|
+
} = require('@toa.io/core')
|
|
5
8
|
|
|
6
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
binding,
|
|
11
|
+
Factory
|
|
12
|
+
} = require('../../src/binding')
|
|
7
13
|
|
|
8
14
|
const factory = new Factory()
|
|
9
15
|
|
|
@@ -52,3 +58,21 @@ it('should call receiver', async () => {
|
|
|
52
58
|
|
|
53
59
|
expect(callback).toHaveBeenCalledWith(message)
|
|
54
60
|
})
|
|
61
|
+
|
|
62
|
+
it('should not modify message', async () => {
|
|
63
|
+
const callback = jest.fn((payload) => {
|
|
64
|
+
payload.payload.foo = 'bar'
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
await binding.subscribe(label, callback)
|
|
68
|
+
|
|
69
|
+
const payload = { [generate()]: generate() }
|
|
70
|
+
|
|
71
|
+
/** @type {toa.core.Message} */
|
|
72
|
+
const message = { payload }
|
|
73
|
+
const origin = JSON.parse(JSON.stringify(message))
|
|
74
|
+
|
|
75
|
+
await emitter.emit(message)
|
|
76
|
+
|
|
77
|
+
expect(origin).toEqual(message)
|
|
78
|
+
})
|