Skip to content

Commit

Permalink
fix: move sharp to be async so it doesn't throw errors when not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
steve8708 committed Jun 14, 2024
1 parent 550de5f commit c86f371
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/visual-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { findVisualFile } from './find-visual-file';
import { getScreenshot } from './get-screenshot';
import { formatMessage } from './test';
import dedent from 'dedent';
import sharp from 'sharp';
import { outputFile } from './output-file';

// use sharp to combine two images, putting them side by side
const combineTwoImages = async (image1: string, image2: string) => {
const { default: sharp } = await import('sharp');
const image1Buffer = Buffer.from(image1.split(',')[1], 'base64');
const image2Buffer = Buffer.from(image2.split(',')[1], 'base64');

Expand Down

0 comments on commit c86f371

Please sign in to comment.