Skip to content

Commit 092094d

Browse files
authored
[Schema Registry] Add Json package in ci.yml file (Azure#26746)
1 parent 414d5ad commit 092094d

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

sdk/schemaregistry/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ extends:
3030
safeName: azureschemaregistry
3131
- name: azure-schema-registry-avro
3232
safeName: azureschemaregistryavro
33+
- name: azure-schema-registry-json
34+
safeName: azureschemaregistryjson

sdk/schemaregistry/schema-registry-json/test/public/errors.spec.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT license.
33

4-
import { assert, isNode } from "@azure/test-utils";
4+
import { assert } from "@azure/test-utils";
55
import { JsonSerializer } from "../../src";
66
import { Context } from "mocha";
77
import { SchemaRegistry } from "@azure/schema-registry";
@@ -165,6 +165,9 @@ describe("Error scenarios", function () {
165165
);
166166
});
167167
it("schema with invalid ID", async function () {
168+
if (!isLiveMode()) {
169+
this.skip();
170+
}
168171
await assertError(
169172
serializer.serialize(
170173
null,
@@ -219,24 +222,20 @@ describe("Error scenarios", function () {
219222
44, 34, 110, 97, 109, 101, 34, 58, 34, 120, 34, 125,
220223
])
221224
);
222-
// const nodeMessage = /Unexpected end of JSON input/;
223225
serializedValue.data = Uint8Array.from([
224226
123, 34, 102, 97, 118, 111, 114, 105, 116, 101, 78, 117, 109, 98, 101, 114,
225227
]);
226228

227229
await assertError(serializer.deserialize(serializedValue), {
228-
causeMessage: isNode
229-
? /Unexpected end of JSON input/
230-
: /Unterminated string in JSON at position/,
230+
causeMessage: /[Unexpected end of JSON input]|[Unterminated string in JSON at position]/,
231231
});
232232
serializedValue.data = Uint8Array.from([
233233
123, 34, 102, 97, 118, 111, 114, 105, 116, 101, 78, 117, 109, 98, 101, 114, 34, 58, 49, 44,
234234
34, 110, 97, 109, 101, 34, 58, 34, 120, 34, 125, 110,
235235
]);
236236
await assertError(serializer.deserialize(serializedValue), {
237-
causeMessage: isNode
238-
? /Unexpected token n in JSON at position/
239-
: /Unexpected non-whitespace character/,
237+
causeMessage:
238+
/[Unexpected token n in JSON at position]|[Unexpected non-whitespace character]/,
240239
});
241240
});
242241
});

0 commit comments

Comments
 (0)