From aa3594a24563735131c962c7e2f584434f7be8bc Mon Sep 17 00:00:00 2001 From: Hezekiah Hendry Date: Sat, 27 Apr 2024 18:38:01 -0400 Subject: [PATCH] test(schema): fix pt. 1 --- .../schema/tests/lib/SchemaMiddleware.test.ts | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/schema/tests/lib/SchemaMiddleware.test.ts b/packages/schema/tests/lib/SchemaMiddleware.test.ts index cc7cf5a2..127b0146 100644 --- a/packages/schema/tests/lib/SchemaMiddleware.test.ts +++ b/packages/schema/tests/lib/SchemaMiddleware.test.ts @@ -323,42 +323,42 @@ describe('SchemaMiddleware', () => { path: [], value: { str: 'test', num: 1, arr: [] } }); + }); - test('GIVEN valid data THEN passes', async () => { - await store.provider[Method.Set]({ method: Method.Set, errors: [], key: 'key', path: [], value: { str: 'test', num: 1, arr: [] } }); + test('GIVEN valid data THEN passes', async () => { + await store.provider[Method.Set]({ method: Method.Set, errors: [], key: 'key', path: [], value: { str: 'test', num: 1, arr: [] } }); - await expect(schema[Method.Set]({ method: Method.Set, errors: [], key: 'key', path: ['str'], value: 'test' })).resolves.toStrictEqual({ - method: Method.Set, - errors: [], - key: 'key', - path: ['str'], - value: 'test' - }); + await expect(schema[Method.Set]({ method: Method.Set, errors: [], key: 'key', path: ['str'], value: 'test' })).resolves.toStrictEqual({ + method: Method.Set, + errors: [], + key: 'key', + path: ['str'], + value: 'test' }); + }); - test('GIVEN invalid data THEN throws', async () => { - await store.provider[Method.Set]({ method: Method.Set, errors: [], key: 'key', path: [], value: { str: 1, num: 'test', arr: [] } }); + test('GIVEN invalid data THEN throws', async () => { + await store.provider[Method.Set]({ method: Method.Set, errors: [], key: 'key', path: [], value: { str: 1, num: 'test', arr: [] } }); - const payload = await schema[Method.Set]({ method: Method.Set, errors: [], key: 'key', path: ['str'], value: 'test' }); - const { method, key, path, errors } = payload; - const { context } = errors[0]; + const payload = await schema[Method.Set]({ method: Method.Set, errors: [], key: 'key', path: ['str'], value: 'test' }); + const { method, key, path, errors } = payload; + const { context } = errors[0]; - expect(method).toBe(Method.Set); - expect(key).toBe('key'); - expect(path).toStrictEqual(['str']); - expect(context.shapeshiftError).toBeInstanceOf(CombinedPropertyError); - }); + expect(method).toBe(Method.Set); + expect(key).toBe('key'); + expect(path).toStrictEqual(['str']); + expect(context.shapeshiftError).toBeInstanceOf(CombinedPropertyError); + }); - test('GIVEN invalid value THEN throws', async () => { - const payload = await schema[Method.Set]({ method: Method.Set, errors: [], key: 'key', path: [], value: { str: 1, num: 'test', arr: [] } }); - const { method, key, path, errors } = payload; - const { context } = errors[0]; + test('GIVEN invalid value THEN throws', async () => { + const payload = await schema[Method.Set]({ method: Method.Set, errors: [], key: 'key', path: [], value: { str: 1, num: 'test', arr: [] } }); + const { method, key, path, errors } = payload; + const { context } = errors[0]; - expect(method).toBe(Method.Set); - expect(key).toBe('key'); - expect(path).toStrictEqual([]); - expect(context.shapeshiftError).toBeInstanceOf(CombinedPropertyError); - }); + expect(method).toBe(Method.Set); + expect(key).toBe('key'); + expect(path).toStrictEqual([]); + expect(context.shapeshiftError).toBeInstanceOf(CombinedPropertyError); }); describe(Method.SetMany, () => {