Skip to content

Commit f401911

Browse files
authored
Merge branch 'stage' into fix-conflict
2 parents e3deefe + 2af828a commit f401911

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/lib/processSnapshot.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ export default async function processSnapshot(snapshot: Snapshot, ctx: Context):
242242
}
243243
}
244244
}
245+
if(options.ignoreType){
246+
processedOptions.ignoreType = options.ignoreType;
247+
}
245248
}
246249

247250
// process for every viewport

src/lib/schemaValidation.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,15 @@ const SnapshotSchema: JSONSchemaType<Snapshot> = {
294294
},
295295
}
296296
},
297+
ignoreType:{
298+
type: "array",
299+
items: { type: "string", minLength: 1,
300+
enum: ["default", "layout", "images", "text", "colors", "dimensions", "position", "structure"],
301+
errorMessage: "Invalid snapshot options;ignoreType cannot be empty"
302+
},
303+
uniqueItems: true,
304+
errorMessage: "Invalid snapshot options; ignoreType must be an array of unique values from default, layout, images, text, colors, dimensions, position, structure"
305+
},
297306
web: {
298307
type: "object",
299308
properties: {

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export interface Snapshot {
105105
orientation?: string
106106
},
107107
loadDomContent?: boolean;
108+
ignoreType?: string[]
108109
}
109110
}
110111

0 commit comments

Comments
 (0)