@toa.io/norm 0.5.0-dev.0 → 0.5.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.
@@ -16,7 +16,7 @@ it('should be', () => undefined)
16
16
  let context
17
17
 
18
18
  beforeEach(() => {
19
- const manifest = {
19
+ const manifest = /** @type {toa.norm.component.Declaration} */ {
20
20
  name: 'test',
21
21
  namespace: 'features',
22
22
  version: '1.0.0',
@@ -65,12 +65,11 @@ describe('When I declare receiver for {label} with:', () => {
65
65
 
66
66
  it('should declare receiver', () => {
67
67
  const event = 'assignment'
68
- const input = {
69
- binding: 'amqp'
70
- }
68
+ const input = { binding: 'amqp' }
71
69
  const yaml = dump(input)
72
70
 
73
71
  step.call(context, event, yaml)
72
+
74
73
  expect(context.manifest.receivers[event]).toStrictEqual(input)
75
74
  })
76
75
 
@@ -83,14 +82,14 @@ describe('Then normalized receiver for event {label} must contain:', () => {
83
82
 
84
83
  it('should throw if does not contain', async () => {
85
84
  const label = generate()
86
- const operation = generate();
85
+ const operation = generate()
87
86
 
88
87
  context.manifest.operations = {
89
- [operation]: {
90
- type: 'transition',
91
- scope: 'object',
92
- concurrency: 'none'
93
- }
88
+ [operation]: {
89
+ type: 'transition',
90
+ scope: 'object',
91
+ concurrency: 'none'
92
+ }
94
93
  }
95
94
 
96
95
  context.manifest.receivers = {
@@ -102,10 +101,7 @@ describe('Then normalized receiver for event {label} must contain:', () => {
102
101
  }
103
102
  }
104
103
 
105
- const input = {
106
- binding: 'sql',
107
- }
108
-
104
+ const input = { binding: 'kafka' }
109
105
  const yaml = dump({ input })
110
106
 
111
107
  await expect(step.call(context, label, yaml)).rejects.toThrow(AssertionError)
@@ -113,7 +109,7 @@ describe('Then normalized receiver for event {label} must contain:', () => {
113
109
 
114
110
  it('should not throw if contain', async () => {
115
111
  const label = generate()
116
- const operation = generate();
112
+ const operation = generate()
117
113
 
118
114
  context.manifest.operations = {
119
115
  [operation]: {
@@ -132,9 +128,7 @@ describe('Then normalized receiver for event {label} must contain:', () => {
132
128
  }
133
129
  }
134
130
 
135
- const yaml = dump({
136
- transition: operation
137
- })
131
+ const yaml = dump({ transition: operation })
138
132
 
139
133
  await expect(step.call(context, label, yaml)).resolves.not.toThrow()
140
134
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/norm",
3
- "version": "0.5.0-dev.0",
3
+ "version": "0.5.0",
4
4
  "description": "Toa declarations normalization and validation",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -19,10 +19,10 @@
19
19
  "test": "echo \"Error: run tests from root\" && exit 1"
20
20
  },
21
21
  "devDependencies": {
22
- "@toa.io/mock": "0.5.0-dev.0"
22
+ "@toa.io/mock": "0.5.0"
23
23
  },
24
24
  "dependencies": {
25
- "@toa.io/core": "0.5.0-dev.0",
25
+ "@toa.io/core": "0.5.0",
26
26
  "@toa.io/generic": "0.4.0",
27
27
  "@toa.io/schema": "0.4.0",
28
28
  "@toa.io/schemas": "0.4.0",