MCPcopy
hub / github.com/processing/p5.js / visualSuite

Function visualSuite

test/unit/visual/visualTest.js:52–83  ·  view source on GitHub ↗
(
  name,
  callback,
  { focus = false, skip = false, shiftThreshold: newShiftThreshold } = {}
)

Source from the content-addressed store, hash-verified

50 * key `focus` to true to only run this test, or its `skip` key to skip it.
51 */
52export function visualSuite(
53 name,
54 callback,
55 { focus = false, skip = false, shiftThreshold: newShiftThreshold } = {}
56) {
57 let suiteFn = describe;
58 if (focus) {
59 suiteFn = suiteFn.only;
60 }
61 if (skip) {
62 suiteFn = suiteFn.skip;
63 }
64 suiteFn(name, () => {
65 let lastShiftThreshold;
66 let lastPrefix;
67 beforeAll(() => {
68 lastPrefix = namePrefix;
69 namePrefix += escapeName(name) + '/';
70 lastShiftThreshold = shiftThreshold;
71 if (newShiftThreshold !== undefined) {
72 shiftThreshold = newShiftThreshold;
73 }
74 });
75
76 callback();
77
78 afterAll(() => {
79 namePrefix = lastPrefix;
80 shiftThreshold = lastShiftThreshold;
81 });
82 });
83}
84
85/**
86 * Image Diff Algorithm for p5.js Visual Tests

Callers 6

typography.jsFile · 0.90
shape_modes.jsFile · 0.90
webgpu.jsFile · 0.90
shapes.jsFile · 0.90
webgl.jsFile · 0.90
noise.jsFile · 0.90

Calls 1

escapeNameFunction · 0.85

Tested by

no test coverage detected