From c2153221ef771257bea184a37d165ea4bfecaa49 Mon Sep 17 00:00:00 2001 From: winkerVSbecks Date: Wed, 14 Aug 2024 08:39:59 -0400 Subject: [PATCH] add key to configuration to fix #1022 --- node-src/lib/getConfiguration.test.ts | 2 ++ node-src/lib/getConfiguration.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/node-src/lib/getConfiguration.test.ts b/node-src/lib/getConfiguration.test.ts index 52326cf88..39ad5a6c0 100644 --- a/node-src/lib/getConfiguration.test.ts +++ b/node-src/lib/getConfiguration.test.ts @@ -13,6 +13,7 @@ beforeEach(() => { it('reads configuration successfully', async () => { mockedReadFile.mockReturnValue( JSON.stringify({ + $schema: 'https://www.chromatic.com/config-file.schema.json', projectId: 'project-id', projectToken: 'project-token', @@ -47,6 +48,7 @@ it('reads configuration successfully', async () => { ); expect(await getConfiguration()).toEqual({ + $schema: 'https://www.chromatic.com/config-file.schema.json', configFile: 'chromatic.config.json', projectId: 'project-id', projectToken: 'project-token', diff --git a/node-src/lib/getConfiguration.ts b/node-src/lib/getConfiguration.ts index a0e416c1d..454205c64 100644 --- a/node-src/lib/getConfiguration.ts +++ b/node-src/lib/getConfiguration.ts @@ -6,6 +6,8 @@ import { invalidConfigurationFile } from '../ui/messages/errors/invalidConfigura const configurationSchema = z .object({ + $schema: z.string(), + projectId: z.string(), projectToken: z.string(), // deprecated