Skip to content

Commit a66cd15

Browse files
committed
test(functions): update syntax error test with matcher for invalid escape text
1 parent 4981268 commit a66cd15

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/functions/src/__tests__/schema.test.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,17 @@ describe('Core Functions / Schema', () => {
325325
});
326326

327327
it('and the unicodeRegExp option is true triggers a SyntaxError', async () => {
328-
expect(await runSchema('\\', { schema, unicodeRegExp: true })).toEqual([
328+
const expected = [
329329
{
330330
message: expect.stringContaining('Invalid regular expression: /' + schema.pattern + '/'),
331331
path: [],
332332
},
333-
]);
333+
{
334+
message: expect.stringContaining('Invalid escape'),
335+
path: [],
336+
},
337+
];
338+
expect(await runSchema('\\', { schema, unicodeRegExp: true })).toEqual(expect.arrayContaining(expected));
334339
});
335340
});
336341

0 commit comments

Comments
 (0)