Skip to content

Commit 566d5d7

Browse files
committed
chore: fmt
1 parent 4e22921 commit 566d5d7

1 file changed

Lines changed: 31 additions & 21 deletions

File tree

packages/stream-model-instance-handler/src/__tests__/schema-utils.test.ts

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -102,44 +102,54 @@ describe('SchemaValidation', () => {
102102
})
103103

104104
it('validates content that conforms to schema', async () => {
105-
await expect(schemaValidator.validateSchema(CONTENT_VALID, MODEL_DEFINITION.schema, SCHEMA_COMMIT_ID)).resolves
105+
await expect(
106+
schemaValidator.validateSchema(CONTENT_VALID, MODEL_DEFINITION.schema, SCHEMA_COMMIT_ID)
107+
).resolves
106108
})
107109

108110
it('throws when required properties are missing', async () => {
109-
await expect(schemaValidator.validateSchema(
110-
CONTENT_NO_REQ_PROPS,
111-
MODEL_DEFINITION.schema,
112-
SCHEMA_COMMIT_ID
113-
)).rejects.toMatch(
111+
await expect(
112+
schemaValidator.validateSchema(
113+
CONTENT_NO_REQ_PROPS,
114+
MODEL_DEFINITION.schema,
115+
SCHEMA_COMMIT_ID
116+
)
117+
).rejects.toMatch(
114118
/data must have required property 'arrayProperty', data must have required property 'stringArrayProperty', data must have required property 'stringProperty', data must have required property 'intProperty', data must have required property 'floatProperty'/
115119
)
116120
})
117121

118122
it('throws when min values requirements are not respected', async () => {
119-
await expect(schemaValidator.validateSchema(
120-
CONTENT_MINS_NOT_RESPECTED,
121-
MODEL_DEFINITION.schema,
122-
SCHEMA_COMMIT_ID
123-
)).rejects.toMatch(
123+
await expect(
124+
schemaValidator.validateSchema(
125+
CONTENT_MINS_NOT_RESPECTED,
126+
MODEL_DEFINITION.schema,
127+
SCHEMA_COMMIT_ID
128+
)
129+
).rejects.toMatch(
124130
/data\/arrayProperty must NOT have fewer than 2 items, data\/stringArrayProperty\/0 must NOT have fewer than 2 characters, data\/stringProperty must NOT have fewer than 3 characters, data\/intProperty must be >= 2, data\/floatProperty must be >= 3/
125131
)
126132
})
127133

128134
it('throws when max values requirements are not respected', async () => {
129-
await expect(schemaValidator.validateSchema(
130-
CONTENT_MAXS_NOT_RESPECTED,
131-
MODEL_DEFINITION.schema,
132-
SCHEMA_COMMIT_ID
133-
)).rejects.toMatch(
135+
await expect(
136+
schemaValidator.validateSchema(
137+
CONTENT_MAXS_NOT_RESPECTED,
138+
MODEL_DEFINITION.schema,
139+
SCHEMA_COMMIT_ID
140+
)
141+
).rejects.toMatch(
134142
/data\/arrayProperty must NOT have more than 4 items, data\/stringArrayProperty\/0 must NOT have more than 6 characters, data\/stringProperty must NOT have more than 8 characters, data\/intProperty must be <= 100, data\/floatProperty must be <= 110/
135143
)
136144
})
137145

138146
it('throws when additional values are given', async () => {
139-
await expect(schemaValidator.validateSchema(
140-
CONTENT_WITH_ADDITIONAL_PROPERTY,
141-
MODEL_DEFINITION.schema,
142-
SCHEMA_COMMIT_ID
143-
)).rejects.toMatch(/data must NOT have additional properties/)
147+
await expect(
148+
schemaValidator.validateSchema(
149+
CONTENT_WITH_ADDITIONAL_PROPERTY,
150+
MODEL_DEFINITION.schema,
151+
SCHEMA_COMMIT_ID
152+
)
153+
).rejects.toMatch(/data must NOT have additional properties/)
144154
})
145155
})

0 commit comments

Comments
 (0)