From 2d126605a65079c4370ade6ebfde3e2d8fa9c067 Mon Sep 17 00:00:00 2001 From: Matthew Weeks Date: Fri, 1 Sep 2023 19:34:07 -0400 Subject: [PATCH] fix tests - add options to mock and add better error assertion --- node-src/main.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node-src/main.test.ts b/node-src/main.test.ts index b30113b9e..b15b57ca9 100644 --- a/node-src/main.test.ts +++ b/node-src/main.test.ts @@ -331,6 +331,7 @@ const getContext = ( }, packagePath: '', statsPath: 'preview-stats.json', + options: {}, ...parseArgs(argv), } as any; }; @@ -358,7 +359,7 @@ it('passes options error to onTaskError', async () => { expect.anything(), // Context expect.objectContaining({ formattedError: expect.stringContaining('Missing project token'), // Long formatted error fatalError https://github.com/chromaui/chromatic-cli/blob/217e77671179748eb4ddb8becde78444db93d067/node-src/ui/messages/errors/fatalError.ts#L11 - originalError: expect.anything(), // No jest matcher for an error. + originalError: expect.any(Error), }) ); });