Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/matchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ declare global {
}
}

export const toMatchBaseline = (latestPath: string) => {
export const toMatchBaseline = (
latestPath: string,
options?: { threshold?: number }
) => {
const platform = process.env.OWL_PLATFORM as Platform;
const screenshotsDir = path.join(path.dirname(latestPath), '..', '..');
const baselinePath = path.join(
Expand Down Expand Up @@ -56,7 +59,8 @@ export const toMatchBaseline = (latestPath: string) => {
latestImage.data,
diffImage.data,
baselineImage.width,
baselineImage.height
baselineImage.height,
{ threshold: options?.threshold }
);

if (diffPixelsCount === 0) {
Expand Down