Skip to content

Commit

Permalink
fix tests - add options to mock and add better error assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
weeksling committed Sep 1, 2023
1 parent f635661 commit 5d26bae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion node-src/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ const getContext = (
},
packagePath: '',
statsPath: 'preview-stats.json',
options: {},
...parseArgs(argv),
} as any;
};
Expand Down Expand Up @@ -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), // No jest matcher for an error.
})
);
});
Expand Down

0 comments on commit 5d26bae

Please sign in to comment.