@api-client/core 0.14.9 → 0.15.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.
Files changed (110) hide show
  1. package/RELEASE.md +163 -0
  2. package/RELEASE_SETUP.md +235 -0
  3. package/build/src/events/authorization/AuthorizationEvents.d.ts +1 -1
  4. package/build/src/events/authorization/AuthorizationEvents.d.ts.map +1 -1
  5. package/build/src/events/authorization/AuthorizationEvents.js +1 -1
  6. package/build/src/events/authorization/AuthorizationEvents.js.map +1 -1
  7. package/build/src/events/cookies/CookieEvents.d.ts +1 -1
  8. package/build/src/events/cookies/CookieEvents.d.ts.map +1 -1
  9. package/build/src/events/cookies/CookieEvents.js +1 -1
  10. package/build/src/events/cookies/CookieEvents.js.map +1 -1
  11. package/build/src/modeling/DataDomain.d.ts +45 -3
  12. package/build/src/modeling/DataDomain.d.ts.map +1 -1
  13. package/build/src/modeling/DataDomain.js +81 -3
  14. package/build/src/modeling/DataDomain.js.map +1 -1
  15. package/build/src/modeling/DomainElement.d.ts +7 -0
  16. package/build/src/modeling/DomainElement.d.ts.map +1 -1
  17. package/build/src/modeling/DomainElement.js +14 -0
  18. package/build/src/modeling/DomainElement.js.map +1 -1
  19. package/build/src/modeling/DomainImpactAnalysis.d.ts +22 -119
  20. package/build/src/modeling/DomainImpactAnalysis.d.ts.map +1 -1
  21. package/build/src/modeling/DomainImpactAnalysis.js +49 -155
  22. package/build/src/modeling/DomainImpactAnalysis.js.map +1 -1
  23. package/build/src/modeling/DomainValidation.d.ts +8 -0
  24. package/build/src/modeling/DomainValidation.d.ts.map +1 -0
  25. package/build/src/modeling/DomainValidation.js +99 -0
  26. package/build/src/modeling/DomainValidation.js.map +1 -0
  27. package/build/src/modeling/types.d.ts +70 -0
  28. package/build/src/modeling/types.d.ts.map +1 -1
  29. package/build/src/modeling/types.js.map +1 -1
  30. package/build/src/modeling/validation/entity_validation.js +1 -1
  31. package/build/src/modeling/validation/entity_validation.js.map +1 -1
  32. package/build/src/modeling/validation/rules.d.ts +2 -3
  33. package/build/src/modeling/validation/rules.d.ts.map +1 -1
  34. package/build/src/modeling/validation/rules.js.map +1 -1
  35. package/build/src/modeling/validation/semantic_validation.d.ts +31 -0
  36. package/build/src/modeling/validation/semantic_validation.d.ts.map +1 -0
  37. package/build/src/modeling/validation/semantic_validation.js +126 -0
  38. package/build/src/modeling/validation/semantic_validation.js.map +1 -0
  39. package/build/tsconfig.tsbuildinfo +1 -1
  40. package/data/models/example-generator-api.json +12 -12
  41. package/noop.ts +3 -0
  42. package/package.json +9 -4
  43. package/src/events/authorization/AuthorizationEvents.ts +1 -1
  44. package/src/events/cookies/CookieEvents.ts +1 -1
  45. package/src/modeling/DataDomain.ts +84 -3
  46. package/src/modeling/DomainElement.ts +16 -0
  47. package/src/modeling/DomainImpactAnalysis.ts +54 -239
  48. package/src/modeling/DomainValidation.ts +105 -0
  49. package/src/modeling/types.ts +86 -0
  50. package/src/modeling/validation/entity_validation.ts +1 -1
  51. package/src/modeling/validation/rules.ts +2 -4
  52. package/src/modeling/validation/semantic_validation.ts +145 -0
  53. package/tests/unit/events/EventsTestHelpers.ts +16 -0
  54. package/tests/unit/events/amf.spec.ts +151 -0
  55. package/tests/unit/events/authorization.spec.ts +150 -0
  56. package/tests/unit/events/cookie.spec.ts +274 -0
  57. package/tests/unit/events/encryption.spec.ts +108 -0
  58. package/tests/unit/events/events_polyfills.ts +77 -0
  59. package/tests/unit/events/process.spec.ts +120 -0
  60. package/tests/unit/events/reporting.spec.ts +82 -0
  61. package/tests/unit/events/telemetry.spec.ts +224 -0
  62. package/tests/unit/events/transport.spec.ts +139 -0
  63. package/tests/unit/modeling/data_domain_foreign.spec.ts +244 -0
  64. package/tests/unit/modeling/domain_impact_analysis.spec.ts +0 -110
  65. package/tests/unit/modeling/domain_validation.spec.ts +94 -0
  66. package/tests/unit/modeling/validation/semantic_validation.spec.ts +91 -0
  67. package/tests/unit/models/environment.spec.ts +574 -0
  68. package/tests/unit/models/error_response.spec.ts +183 -0
  69. package/tests/unit/models/headers_array.spec.ts +86 -0
  70. package/tests/unit/models/http-actions/assertion/equal_assertion.spec.ts +103 -0
  71. package/tests/unit/models/http-actions/assertion/greater_than_assertion.spec.ts +91 -0
  72. package/tests/unit/models/http-actions/assertion/includes_assertion.spec.ts +71 -0
  73. package/tests/unit/models/http-actions/assertion/less_than_assertion.spec.ts +91 -0
  74. package/tests/unit/models/http-actions/assertion/matches_assertion.spec.ts +71 -0
  75. package/tests/unit/models/http-actions/assertion/matches_schema_assertion.spec.ts +117 -0
  76. package/tests/unit/models/http-actions/assertion/not_equal_assertion.spec.ts +103 -0
  77. package/tests/unit/models/http-actions/assertion/not_includes_assertion.spec.ts +71 -0
  78. package/tests/unit/models/http-actions/assertion/not_ok_assertion.spec.ts +47 -0
  79. package/tests/unit/models/http-actions/assertion/not_to_be_assertion.spec.ts +72 -0
  80. package/tests/unit/models/http-actions/assertion/ok_assertion.spec.ts +44 -0
  81. package/tests/unit/models/http-actions/assertion/to_be_assertion.spec.ts +71 -0
  82. package/tests/unit/models/http-actions/transformation/as_lower_case_step.spec.ts +47 -0
  83. package/tests/unit/models/http-actions/transformation/as_number_step.spec.ts +47 -0
  84. package/tests/unit/models/http-actions/transformation/as_upper_case_step.spec.ts +47 -0
  85. package/tests/unit/models/http-actions/transformation/round_step.spec.ts +69 -0
  86. package/tests/unit/models/http-actions/transformation/substring_step.spec.ts +85 -0
  87. package/tests/unit/models/http-actions/transformation/trim_step.spec.ts +44 -0
  88. package/tests/unit/models/http_cookie.spec.ts +516 -0
  89. package/tests/unit/models/http_history.spec.ts +443 -0
  90. package/tests/unit/models/project_folder.spec.ts +926 -0
  91. package/tests/unit/models/project_item.spec.ts +137 -0
  92. package/tests/unit/models/project_request.spec.ts +1047 -0
  93. package/tests/unit/models/project_schema.spec.ts +236 -0
  94. package/tests/unit/models/property.spec.ts +625 -0
  95. package/tests/unit/models/provider.spec.ts +102 -0
  96. package/tests/unit/models/request.spec.ts +1206 -0
  97. package/tests/unit/models/request_log.spec.ts +308 -0
  98. package/tests/unit/models/request_time.spec.ts +138 -0
  99. package/tests/unit/models/response_redirect.spec.ts +303 -0
  100. package/tests/unit/models/sent_request.spec.ts +206 -0
  101. package/tests/unit/models/server.spec.ts +195 -0
  102. package/tests/unit/models/thing.spec.ts +154 -0
  103. package/build/oauth-popup.html +0 -33
  104. /package/tests/unit/models/{Certificate.spec.ts → certificate.spec.ts} +0 -0
  105. /package/tests/unit/models/{HostRule.spec.ts → host_rule.spec.ts} +0 -0
  106. /package/tests/unit/models/{HttpProject.spec.ts → http_project.spec.ts} +0 -0
  107. /package/tests/unit/models/{HttpRequest.spec.ts → http_request.spec.ts} +0 -0
  108. /package/tests/unit/models/{HttpResponse.spec.ts → http_response.spec.ts} +0 -0
  109. /package/tests/unit/models/{License.spec.ts → license.spec.ts} +0 -0
  110. /package/tests/unit/models/{Response.spec.ts → response.spec.ts} +0 -0
@@ -0,0 +1,71 @@
1
+ import { test } from '@japa/runner'
2
+ import { assert } from '@esm-bundle/chai'
3
+ import {
4
+ MatchesAssertion,
5
+ MatchesAssertionKind,
6
+ } from '../../../../../src/models/http-flows/steps/assertion/MatchesAssertion.js'
7
+
8
+ test.group('MatchesAssertion constructor()', () => {
9
+ test('initializes from values', () => {
10
+ const instance = new MatchesAssertion('test-value')
11
+ assert.equal(instance.value, 'test-value')
12
+ assert.isTrue(instance.enabled)
13
+ })
14
+
15
+ test('initializes from the schema', () => {
16
+ const instance = new MatchesAssertion({
17
+ kind: MatchesAssertionKind,
18
+ value: 'test-value',
19
+ enabled: false,
20
+ })
21
+ assert.equal(instance.value, 'test-value')
22
+ assert.isFalse(instance.enabled)
23
+ })
24
+
25
+ test('initializes empty class', () => {
26
+ const instance = new MatchesAssertion()
27
+ assert.equal(instance.kind, MatchesAssertionKind)
28
+ assert.isUndefined(instance.enabled)
29
+ assert.isUndefined(instance.value)
30
+ })
31
+ })
32
+
33
+ test.group('MatchesAssertion checkValidity()', () => {
34
+ test('returns true when has the value', () => {
35
+ const instance = new MatchesAssertion('test-value')
36
+ assert.isTrue(instance.checkValidity())
37
+ })
38
+
39
+ test('returns false when has no value', () => {
40
+ const instance = new MatchesAssertion()
41
+ assert.isFalse(instance.checkValidity())
42
+ })
43
+ })
44
+
45
+ test.group('MatchesAssertion toJSON()', () => {
46
+ test('serializes the kind', () => {
47
+ const instance = new MatchesAssertion('test-value')
48
+ assert.equal(instance.kind, MatchesAssertionKind)
49
+ })
50
+
51
+ test('serializes the value when set', () => {
52
+ const instance = new MatchesAssertion('test-value')
53
+ assert.equal(instance.value, 'test-value')
54
+ })
55
+
56
+ test('ignores the value when not set', () => {
57
+ const instance = new MatchesAssertion()
58
+ assert.isUndefined(instance.value)
59
+ })
60
+
61
+ test('serializes the enabled when set', () => {
62
+ const instance = new MatchesAssertion('test-value')
63
+ instance.enabled = true
64
+ assert.isTrue(instance.enabled)
65
+ })
66
+
67
+ test('ignores the enabled when not set', () => {
68
+ const instance = new MatchesAssertion()
69
+ assert.isUndefined(instance.enabled)
70
+ })
71
+ })
@@ -0,0 +1,117 @@
1
+ import { test } from '@japa/runner'
2
+ import { assert } from '@esm-bundle/chai'
3
+ import {
4
+ MatchesSchemaAssertion,
5
+ MatchesSchemaAssertionKind,
6
+ } from '../../../../../src/models/http-flows/steps/assertion/MatchesSchemaAssertion.js'
7
+
8
+ test.group('MatchesSchemaAssertion constructor()', () => {
9
+ test('initializes from the schema', () => {
10
+ const instance = new MatchesSchemaAssertion({
11
+ kind: MatchesSchemaAssertionKind,
12
+ ref: 'test-ref',
13
+ schema: 'test-schema',
14
+ enabled: false,
15
+ })
16
+ assert.equal(instance.schema, 'test-schema')
17
+ assert.equal(instance.ref, 'test-ref')
18
+ assert.isFalse(instance.enabled)
19
+ })
20
+
21
+ test('initializes empty class', () => {
22
+ const instance = new MatchesSchemaAssertion()
23
+ assert.equal(instance.kind, MatchesSchemaAssertionKind)
24
+ assert.isUndefined(instance.enabled)
25
+ assert.isUndefined(instance.ref)
26
+ assert.isUndefined(instance.schema)
27
+ })
28
+ })
29
+
30
+ test.group('MatchesSchemaAssertion fromRef()', () => {
31
+ test('sets the ref', () => {
32
+ const instance = MatchesSchemaAssertion.fromRef('test-value')
33
+ assert.equal(instance.ref, 'test-value')
34
+ })
35
+
36
+ test('does not set the schema', () => {
37
+ const instance = MatchesSchemaAssertion.fromRef('test-value')
38
+ assert.isUndefined(instance.schema)
39
+ })
40
+
41
+ test('sets it enabled', () => {
42
+ const instance = MatchesSchemaAssertion.fromRef('test-value')
43
+ assert.isTrue(instance.enabled)
44
+ })
45
+ })
46
+
47
+ test.group('MatchesSchemaAssertion fromSchema()', () => {
48
+ test('sets the ref', () => {
49
+ const instance = MatchesSchemaAssertion.fromSchema('test-value')
50
+ assert.equal(instance.schema, 'test-value')
51
+ })
52
+
53
+ test('does not set the ref', () => {
54
+ const instance = MatchesSchemaAssertion.fromSchema('test-value')
55
+ assert.isUndefined(instance.ref)
56
+ })
57
+
58
+ test('sets it enabled', () => {
59
+ const instance = MatchesSchemaAssertion.fromSchema('test-value')
60
+ assert.isTrue(instance.enabled)
61
+ })
62
+ })
63
+
64
+ test.group('MatchesSchemaAssertion checkValidity()', () => {
65
+ test('returns true when has ref', () => {
66
+ const instance = MatchesSchemaAssertion.fromRef('test-value')
67
+ assert.isTrue(instance.checkValidity())
68
+ })
69
+
70
+ test('returns true when has schema', () => {
71
+ const instance = MatchesSchemaAssertion.fromSchema('test-value')
72
+ assert.isTrue(instance.checkValidity())
73
+ })
74
+
75
+ test('returns false when no ref or schema', () => {
76
+ const instance = new MatchesSchemaAssertion()
77
+ assert.isFalse(instance.checkValidity())
78
+ })
79
+ })
80
+
81
+ test.group('MatchesSchemaAssertion toJSON()', () => {
82
+ test('serializes the kind', () => {
83
+ const instance = new MatchesSchemaAssertion()
84
+ assert.equal(instance.kind, MatchesSchemaAssertionKind)
85
+ })
86
+
87
+ test('serializes the ref when set', () => {
88
+ const instance = MatchesSchemaAssertion.fromRef('test-value')
89
+ assert.equal(instance.ref, 'test-value')
90
+ })
91
+
92
+ test('ignores the ref when not set', () => {
93
+ const instance = new MatchesSchemaAssertion()
94
+ assert.isUndefined(instance.ref)
95
+ })
96
+
97
+ test('serializes the schema when set', () => {
98
+ const instance = MatchesSchemaAssertion.fromSchema('test-value')
99
+ assert.equal(instance.schema, 'test-value')
100
+ })
101
+
102
+ test('ignores the schema when not set', () => {
103
+ const instance = new MatchesSchemaAssertion()
104
+ assert.isUndefined(instance.schema)
105
+ })
106
+
107
+ test('serializes the enabled when set', () => {
108
+ const instance = new MatchesSchemaAssertion()
109
+ instance.enabled = true
110
+ assert.isTrue(instance.enabled)
111
+ })
112
+
113
+ test('ignores the enabled when not set', () => {
114
+ const instance = new MatchesSchemaAssertion()
115
+ assert.isUndefined(instance.enabled)
116
+ })
117
+ })
@@ -0,0 +1,103 @@
1
+ import { test } from '@japa/runner'
2
+ import { assert } from '@esm-bundle/chai'
3
+ import {
4
+ NotEqualAssertion,
5
+ NotEqualAssertionKind,
6
+ } from '../../../../../src/models/http-flows/steps/assertion/NotEqualAssertion.js'
7
+
8
+ test.group('NotEqualAssertion constructor()', () => {
9
+ test('initializes from values', () => {
10
+ const instance = new NotEqualAssertion('a', true, 'http://www.w3.org/2001/XMLSchema#string')
11
+ assert.equal(instance.value, 'a')
12
+ assert.equal(instance.dataType, 'http://www.w3.org/2001/XMLSchema#string')
13
+ assert.isTrue(instance.strict)
14
+ assert.isTrue(instance.enabled)
15
+ })
16
+
17
+ test('ignores not set values', () => {
18
+ const instance = new NotEqualAssertion('a')
19
+ assert.equal(instance.value, 'a')
20
+ assert.isUndefined(instance.dataType)
21
+ assert.isUndefined(instance.strict)
22
+ })
23
+
24
+ test('initializes from the schema', () => {
25
+ const instance = new NotEqualAssertion({
26
+ kind: NotEqualAssertionKind,
27
+ value: 'a',
28
+ strict: false,
29
+ dataType: 'http://www.w3.org/2001/XMLSchema#boolean',
30
+ enabled: false,
31
+ })
32
+ assert.equal(instance.value, 'a')
33
+ assert.equal(instance.dataType, 'http://www.w3.org/2001/XMLSchema#boolean')
34
+ assert.isFalse(instance.strict)
35
+ assert.isFalse(instance.enabled)
36
+ })
37
+
38
+ test('initializes empty class', () => {
39
+ const instance = new NotEqualAssertion()
40
+ assert.equal(instance.kind, NotEqualAssertionKind)
41
+ assert.isUndefined(instance.enabled)
42
+ })
43
+ })
44
+
45
+ test.group('NotEqualAssertion checkValidity()', () => {
46
+ test('returns true when has the value', () => {
47
+ const instance = new NotEqualAssertion('a', true, 'http://www.w3.org/2001/XMLSchema#string')
48
+ assert.isTrue(instance.checkValidity())
49
+ })
50
+
51
+ test('returns false when has no value', () => {
52
+ const instance = new NotEqualAssertion()
53
+ assert.isFalse(instance.checkValidity())
54
+ })
55
+ })
56
+
57
+ test.group('NotEqualAssertion toJSON()', () => {
58
+ test('serializes the kind', () => {
59
+ const instance = new NotEqualAssertion('a', true, 'http://www.w3.org/2001/XMLSchema#string')
60
+ assert.equal(instance.kind, NotEqualAssertionKind)
61
+ })
62
+
63
+ test('serializes the value when set', () => {
64
+ const instance = new NotEqualAssertion('a', true, 'http://www.w3.org/2001/XMLSchema#string')
65
+ assert.equal(instance.value, 'a')
66
+ })
67
+
68
+ test('ignores the value when not set', () => {
69
+ const instance = new NotEqualAssertion()
70
+ assert.isUndefined(instance.value)
71
+ })
72
+
73
+ test('serializes the dataType when set', () => {
74
+ const instance = new NotEqualAssertion('a', true, 'http://www.w3.org/2001/XMLSchema#string')
75
+ assert.equal(instance.dataType, 'http://www.w3.org/2001/XMLSchema#string')
76
+ })
77
+
78
+ test('ignores the dataType when not set', () => {
79
+ const instance = new NotEqualAssertion()
80
+ assert.isUndefined(instance.dataType)
81
+ })
82
+
83
+ test('serializes the strict when set', () => {
84
+ const instance = new NotEqualAssertion('a', true, 'http://www.w3.org/2001/XMLSchema#string')
85
+ assert.isTrue(instance.strict)
86
+ })
87
+
88
+ test('ignores the strict when not set', () => {
89
+ const instance = new NotEqualAssertion()
90
+ assert.isUndefined(instance.strict)
91
+ })
92
+
93
+ test('serializes the enabled when set', () => {
94
+ const instance = new NotEqualAssertion('a', true, 'http://www.w3.org/2001/XMLSchema#string')
95
+ instance.enabled = true
96
+ assert.isTrue(instance.enabled)
97
+ })
98
+
99
+ test('ignores the enabled when not set', () => {
100
+ const instance = new NotEqualAssertion()
101
+ assert.isUndefined(instance.enabled)
102
+ })
103
+ })
@@ -0,0 +1,71 @@
1
+ import { test } from '@japa/runner'
2
+ import { assert } from '@esm-bundle/chai'
3
+ import {
4
+ NotIncludesAssertion,
5
+ NotIncludesAssertionKind,
6
+ } from '../../../../../src/models/http-flows/steps/assertion/NotIncludesAssertion.js'
7
+
8
+ test.group('NotIncludesAssertion constructor()', () => {
9
+ test('initializes from values', () => {
10
+ const instance = new NotIncludesAssertion('test-value')
11
+ assert.equal(instance.value, 'test-value')
12
+ assert.isTrue(instance.enabled)
13
+ })
14
+
15
+ test('initializes from the schema', () => {
16
+ const instance = new NotIncludesAssertion({
17
+ kind: NotIncludesAssertionKind,
18
+ value: 'test-value',
19
+ enabled: false,
20
+ })
21
+ assert.equal(instance.value, 'test-value')
22
+ assert.isFalse(instance.enabled)
23
+ })
24
+
25
+ test('initializes empty class', () => {
26
+ const instance = new NotIncludesAssertion()
27
+ assert.equal(instance.kind, NotIncludesAssertionKind)
28
+ assert.isUndefined(instance.enabled)
29
+ assert.isUndefined(instance.value)
30
+ })
31
+ })
32
+
33
+ test.group('NotIncludesAssertion checkValidity()', () => {
34
+ test('returns true when has the value', () => {
35
+ const instance = new NotIncludesAssertion('test-value')
36
+ assert.isTrue(instance.checkValidity())
37
+ })
38
+
39
+ test('returns false when has no value', () => {
40
+ const instance = new NotIncludesAssertion()
41
+ assert.isFalse(instance.checkValidity())
42
+ })
43
+ })
44
+
45
+ test.group('NotIncludesAssertion toJSON()', () => {
46
+ test('serializes the kind', () => {
47
+ const instance = new NotIncludesAssertion('test-value')
48
+ assert.equal(instance.kind, NotIncludesAssertionKind)
49
+ })
50
+
51
+ test('serializes the value when set', () => {
52
+ const instance = new NotIncludesAssertion('test-value')
53
+ assert.equal(instance.value, 'test-value')
54
+ })
55
+
56
+ test('ignores the value when not set', () => {
57
+ const instance = new NotIncludesAssertion()
58
+ assert.isUndefined(instance.value)
59
+ })
60
+
61
+ test('serializes the enabled when set', () => {
62
+ const instance = new NotIncludesAssertion('test-value')
63
+ instance.enabled = true
64
+ assert.isTrue(instance.enabled)
65
+ })
66
+
67
+ test('ignores the enabled when not set', () => {
68
+ const instance = new NotIncludesAssertion()
69
+ assert.isUndefined(instance.enabled)
70
+ })
71
+ })
@@ -0,0 +1,47 @@
1
+ import { test } from '@japa/runner'
2
+ import { assert } from '@esm-bundle/chai'
3
+ import {
4
+ NotOkAssertion,
5
+ NotOkAssertionKind,
6
+ } from '../../../../../src/models/http-flows/steps/assertion/NotOkAssertion.js'
7
+
8
+ test.group('NotOkAssertion constructor()', () => {
9
+ test('initializes from the schema', () => {
10
+ const instance = new NotOkAssertion({
11
+ kind: NotOkAssertionKind,
12
+ enabled: false,
13
+ })
14
+ assert.isFalse(instance.enabled)
15
+ })
16
+
17
+ test('initializes empty class', () => {
18
+ const instance = new NotOkAssertion()
19
+ assert.equal(instance.kind, NotOkAssertionKind)
20
+ assert.isUndefined(instance.enabled)
21
+ })
22
+ })
23
+
24
+ test.group('NotOkAssertion checkValidity()', () => {
25
+ test('returns true', () => {
26
+ const instance = new NotOkAssertion()
27
+ assert.isTrue(instance.checkValidity())
28
+ })
29
+ })
30
+
31
+ test.group('NotOkAssertion toJSON()', () => {
32
+ test('serializes the kind', () => {
33
+ const instance = new NotOkAssertion()
34
+ assert.equal(instance.kind, NotOkAssertionKind)
35
+ })
36
+
37
+ test('serializes the enabled when set', () => {
38
+ const instance = new NotOkAssertion()
39
+ instance.enabled = true
40
+ assert.isTrue(instance.enabled)
41
+ })
42
+
43
+ test('ignores the enabled when not set', () => {
44
+ const instance = new NotOkAssertion()
45
+ assert.isUndefined(instance.enabled)
46
+ })
47
+ })
@@ -0,0 +1,72 @@
1
+ import { test } from '@japa/runner'
2
+ import { assert } from '@esm-bundle/chai'
3
+ import {
4
+ NotToBeAssertion,
5
+ NotToBeAssertionKind,
6
+ } from '../../../../../src/models/http-flows/steps/assertion/NotToBeAssertion.js'
7
+ import { ToBeTypes } from '../../../../../src/models/http-flows/steps/assertion/ToBeAssertion.js'
8
+
9
+ test.group('NotToBeAssertion constructor()', () => {
10
+ test('initializes from values', () => {
11
+ const instance = new NotToBeAssertion(ToBeTypes.number)
12
+ assert.equal(instance.value, ToBeTypes.number)
13
+ assert.isTrue(instance.enabled)
14
+ })
15
+
16
+ test('initializes from the schema', () => {
17
+ const instance = new NotToBeAssertion({
18
+ kind: NotToBeAssertionKind,
19
+ value: ToBeTypes.number,
20
+ enabled: false,
21
+ })
22
+ assert.equal(instance.value, ToBeTypes.number)
23
+ assert.isFalse(instance.enabled)
24
+ })
25
+
26
+ test('initializes empty class', () => {
27
+ const instance = new NotToBeAssertion()
28
+ assert.equal(instance.kind, NotToBeAssertionKind)
29
+ assert.isUndefined(instance.enabled)
30
+ assert.isUndefined(instance.value)
31
+ })
32
+ })
33
+
34
+ test.group('NotToBeAssertion checkValidity()', () => {
35
+ test('returns true when has the value', () => {
36
+ const instance = new NotToBeAssertion(ToBeTypes.number)
37
+ assert.isTrue(instance.checkValidity())
38
+ })
39
+
40
+ test('returns false when has no value', () => {
41
+ const instance = new NotToBeAssertion()
42
+ assert.isFalse(instance.checkValidity())
43
+ })
44
+ })
45
+
46
+ test.group('NotToBeAssertion toJSON()', () => {
47
+ test('serializes the kind', () => {
48
+ const instance = new NotToBeAssertion(ToBeTypes.number)
49
+ assert.equal(instance.kind, NotToBeAssertionKind)
50
+ })
51
+
52
+ test('serializes the value when set', () => {
53
+ const instance = new NotToBeAssertion(ToBeTypes.number)
54
+ assert.equal(instance.value, ToBeTypes.number)
55
+ })
56
+
57
+ test('ignores the value when not set', () => {
58
+ const instance = new NotToBeAssertion()
59
+ assert.isUndefined(instance.value)
60
+ })
61
+
62
+ test('serializes the enabled when set', () => {
63
+ const instance = new NotToBeAssertion(ToBeTypes.number)
64
+ instance.enabled = true
65
+ assert.isTrue(instance.enabled)
66
+ })
67
+
68
+ test('ignores the enabled when not set', () => {
69
+ const instance = new NotToBeAssertion()
70
+ assert.isUndefined(instance.enabled)
71
+ })
72
+ })
@@ -0,0 +1,44 @@
1
+ import { test } from '@japa/runner'
2
+ import { assert } from '@esm-bundle/chai'
3
+ import { OkAssertion, OkAssertionKind } from '../../../../../src/models/http-flows/steps/assertion/OkAssertion.js'
4
+
5
+ test.group('OkAssertion constructor()', () => {
6
+ test('initializes from the schema', () => {
7
+ const instance = new OkAssertion({
8
+ kind: OkAssertionKind,
9
+ enabled: false,
10
+ })
11
+ assert.isFalse(instance.enabled)
12
+ })
13
+
14
+ test('initializes empty class', () => {
15
+ const instance = new OkAssertion()
16
+ assert.equal(instance.kind, OkAssertionKind)
17
+ assert.isUndefined(instance.enabled)
18
+ })
19
+ })
20
+
21
+ test.group('OkAssertion checkValidity()', () => {
22
+ test('returns true', () => {
23
+ const instance = new OkAssertion()
24
+ assert.isTrue(instance.checkValidity())
25
+ })
26
+ })
27
+
28
+ test.group('OkAssertion toJSON()', () => {
29
+ test('serializes the kind', () => {
30
+ const instance = new OkAssertion()
31
+ assert.equal(instance.kind, OkAssertionKind)
32
+ })
33
+
34
+ test('serializes the enabled when set', () => {
35
+ const instance = new OkAssertion()
36
+ instance.enabled = true
37
+ assert.isTrue(instance.enabled)
38
+ })
39
+
40
+ test('ignores the enabled when not set', () => {
41
+ const instance = new OkAssertion()
42
+ assert.isUndefined(instance.enabled)
43
+ })
44
+ })
@@ -0,0 +1,71 @@
1
+ import { test } from '@japa/runner'
2
+ import { assert } from '@esm-bundle/chai'
3
+ import {
4
+ ToBeAssertion,
5
+ ToBeAssertionKind,
6
+ ToBeTypes,
7
+ } from '../../../../../src/models/http-flows/steps/assertion/ToBeAssertion.js'
8
+ test.group('ToBeAssertion constructor()', () => {
9
+ test('initializes from values', () => {
10
+ const instance = new ToBeAssertion(ToBeTypes.number)
11
+ assert.equal(instance.value, ToBeTypes.number)
12
+ assert.isTrue(instance.enabled)
13
+ })
14
+
15
+ test('initializes from the schema', () => {
16
+ const instance = new ToBeAssertion({
17
+ kind: ToBeAssertionKind,
18
+ value: ToBeTypes.number,
19
+ enabled: false,
20
+ })
21
+ assert.equal(instance.value, ToBeTypes.number)
22
+ assert.isFalse(instance.enabled)
23
+ })
24
+
25
+ test('initializes empty class', () => {
26
+ const instance = new ToBeAssertion()
27
+ assert.equal(instance.kind, ToBeAssertionKind)
28
+ assert.isUndefined(instance.enabled)
29
+ assert.isUndefined(instance.value)
30
+ })
31
+ })
32
+
33
+ test.group('ToBeAssertion checkValidity()', () => {
34
+ test('returns true when has the value', () => {
35
+ const instance = new ToBeAssertion(ToBeTypes.number)
36
+ assert.isTrue(instance.checkValidity())
37
+ })
38
+
39
+ test('returns false when has no value', () => {
40
+ const instance = new ToBeAssertion()
41
+ assert.isFalse(instance.checkValidity())
42
+ })
43
+ })
44
+
45
+ test.group('ToBeAssertion toJSON()', () => {
46
+ test('serializes the kind', () => {
47
+ const instance = new ToBeAssertion(ToBeTypes.number)
48
+ assert.equal(instance.kind, ToBeAssertionKind)
49
+ })
50
+
51
+ test('serializes the value when set', () => {
52
+ const instance = new ToBeAssertion(ToBeTypes.number)
53
+ assert.equal(instance.value, ToBeTypes.number)
54
+ })
55
+
56
+ test('ignores the value when not set', () => {
57
+ const instance = new ToBeAssertion()
58
+ assert.isUndefined(instance.value)
59
+ })
60
+
61
+ test('serializes the enabled when set', () => {
62
+ const instance = new ToBeAssertion(ToBeTypes.number)
63
+ instance.enabled = true
64
+ assert.isTrue(instance.enabled)
65
+ })
66
+
67
+ test('ignores the enabled when not set', () => {
68
+ const instance = new ToBeAssertion()
69
+ assert.isUndefined(instance.enabled)
70
+ })
71
+ })
@@ -0,0 +1,47 @@
1
+ import { test } from '@japa/runner'
2
+ import { assert } from '@esm-bundle/chai'
3
+ import {
4
+ AsLowerCaseStep,
5
+ AsLowerCaseStepKind,
6
+ } from '../../../../../src/models/http-flows/steps/transformation/AsLowerCaseStep.js'
7
+
8
+ test.group('AsLowerCaseStep constructor()', () => {
9
+ test('initializes from the schema', () => {
10
+ const instance = new AsLowerCaseStep({
11
+ kind: AsLowerCaseStepKind,
12
+ enabled: false,
13
+ })
14
+ assert.isFalse(instance.enabled)
15
+ })
16
+
17
+ test('initializes empty class', () => {
18
+ const instance = new AsLowerCaseStep()
19
+ assert.equal(instance.kind, AsLowerCaseStepKind)
20
+ assert.isUndefined(instance.enabled)
21
+ })
22
+ })
23
+
24
+ test.group('AsLowerCaseStep checkValidity()', () => {
25
+ test('returns true', () => {
26
+ const instance = new AsLowerCaseStep()
27
+ assert.isTrue(instance.checkValidity())
28
+ })
29
+ })
30
+
31
+ test.group('AsLowerCaseStep toJSON()', () => {
32
+ test('serializes the kind', () => {
33
+ const instance = new AsLowerCaseStep()
34
+ assert.equal(instance.kind, AsLowerCaseStepKind)
35
+ })
36
+
37
+ test('serializes the enabled when set', () => {
38
+ const instance = new AsLowerCaseStep()
39
+ instance.enabled = true
40
+ assert.isTrue(instance.enabled)
41
+ })
42
+
43
+ test('ignores the enabled when not set', () => {
44
+ const instance = new AsLowerCaseStep()
45
+ assert.isUndefined(instance.enabled)
46
+ })
47
+ })
@@ -0,0 +1,47 @@
1
+ import { test } from '@japa/runner'
2
+ import { assert } from '@esm-bundle/chai'
3
+ import {
4
+ AsNumberStep,
5
+ AsNumberStepKind,
6
+ } from '../../../../../src/models/http-flows/steps/transformation/AsNumberStep.js'
7
+
8
+ test.group('AsNumberStep constructor()', () => {
9
+ test('initializes from the schema', () => {
10
+ const instance = new AsNumberStep({
11
+ kind: AsNumberStepKind,
12
+ enabled: false,
13
+ })
14
+ assert.isFalse(instance.enabled)
15
+ })
16
+
17
+ test('initializes empty class', () => {
18
+ const instance = new AsNumberStep()
19
+ assert.equal(instance.kind, AsNumberStepKind)
20
+ assert.isUndefined(instance.enabled)
21
+ })
22
+ })
23
+
24
+ test.group('AsNumberStep checkValidity()', () => {
25
+ test('returns true', () => {
26
+ const instance = new AsNumberStep()
27
+ assert.isTrue(instance.checkValidity())
28
+ })
29
+ })
30
+
31
+ test.group('AsNumberStep toJSON()', () => {
32
+ test('serializes the kind', () => {
33
+ const instance = new AsNumberStep()
34
+ assert.equal(instance.kind, AsNumberStepKind)
35
+ })
36
+
37
+ test('serializes the enabled when set', () => {
38
+ const instance = new AsNumberStep()
39
+ instance.enabled = true
40
+ assert.isTrue(instance.enabled)
41
+ })
42
+
43
+ test('ignores the enabled when not set', () => {
44
+ const instance = new AsNumberStep()
45
+ assert.isUndefined(instance.enabled)
46
+ })
47
+ })