From 75dfe17c390955ef47433d9162634d0d15d9ac28 Mon Sep 17 00:00:00 2001 From: LekoArts Date: Mon, 8 Aug 2022 13:15:54 +0200 Subject: [PATCH] fix tests --- packages/gatsby-plugin-sharp/src/index.js | 2 +- packages/gatsby-plugin-sharp/src/plugin-options.ts | 4 ++-- packages/gatsby-plugin-sharp/src/process-file.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/gatsby-plugin-sharp/src/index.js b/packages/gatsby-plugin-sharp/src/index.js index 693c7cc39c1fe..f770efd3f5912 100644 --- a/packages/gatsby-plugin-sharp/src/index.js +++ b/packages/gatsby-plugin-sharp/src/index.js @@ -262,7 +262,7 @@ async function generateBase64({ file, args = {}, reporter }) { }) let pipeline try { - pipeline = sharp({ failOn: options.failOn }) + pipeline = sharp({ failOn: pluginOptions.failOn }) if (!options.rotate) { pipeline.rotate() diff --git a/packages/gatsby-plugin-sharp/src/plugin-options.ts b/packages/gatsby-plugin-sharp/src/plugin-options.ts index ed191b67f3711..84e5663ed9f84 100644 --- a/packages/gatsby-plugin-sharp/src/plugin-options.ts +++ b/packages/gatsby-plugin-sharp/src/plugin-options.ts @@ -23,7 +23,7 @@ export interface ISharpPluginOptions { useMozJpeg?: boolean stripMetadata?: boolean lazyImageGeneration?: boolean - defaultQuality?: number + defaultQuality: number failOn?: SharpOptions["failOn"] defaults?: PluginOptionsDefaults } @@ -162,7 +162,7 @@ export const healOptions = ( { defaultQuality: quality, base64Width, - }: { defaultQuality: number; base64Width?: number }, + }: Pick, args: ITransformArgs, fileExtension = ``, defaultArgs = {} diff --git a/packages/gatsby-plugin-sharp/src/process-file.ts b/packages/gatsby-plugin-sharp/src/process-file.ts index 059f27540a43b..be848464b1f48 100644 --- a/packages/gatsby-plugin-sharp/src/process-file.ts +++ b/packages/gatsby-plugin-sharp/src/process-file.ts @@ -30,7 +30,7 @@ interface ITransform { export const processFile = async ( file: string, transforms: Array, - options: ISharpPluginOptions = {} + options = {} as ISharpPluginOptions ): Promise> => { let pipeline try {