@quake2ts/test-utils 0.0.813 → 0.0.815

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -4506,7 +4506,7 @@ async function expectSnapshot(pixels, options) {
4506
4506
  name,
4507
4507
  width,
4508
4508
  height,
4509
- updateBaseline = false,
4509
+ updateBaseline: updateBaselineOption = false,
4510
4510
  snapshotDir = import_path.default.join(process.cwd(), "tests", "__snapshots__")
4511
4511
  // Default to current working dir/tests/__snapshots__
4512
4512
  } = options;
@@ -4517,6 +4517,7 @@ async function expectSnapshot(pixels, options) {
4517
4517
  const actualPath = getSnapshotPath(name, "actual", snapshotDir);
4518
4518
  const diffPath = getSnapshotPath(name, "diff", snapshotDir);
4519
4519
  const alwaysSave = process.env.ALWAYS_SAVE_SNAPSHOTS === "1";
4520
+ const updateBaseline = updateBaselineOption || process.env.UPDATE_SNAPSHOTS === "1";
4520
4521
  if (updateBaseline || !(0, import_fs.existsSync)(baselinePath)) {
4521
4522
  console.log(`Creating/Updating baseline for ${name} at ${baselinePath}`);
4522
4523
  await savePNG(pixels, width, height, baselinePath);
@@ -4606,7 +4607,7 @@ async function expectAnimationSnapshot(renderAndCaptureFrame, options) {
4606
4607
  height,
4607
4608
  frameCount,
4608
4609
  fps = 10,
4609
- updateBaseline = false,
4610
+ updateBaseline: updateBaselineOption = false,
4610
4611
  snapshotDir = import_path2.default.join(process.cwd(), "tests", "__snapshots__"),
4611
4612
  threshold = 0.1,
4612
4613
  maxDifferencePercent = 0.1
@@ -4618,6 +4619,7 @@ async function expectAnimationSnapshot(renderAndCaptureFrame, options) {
4618
4619
  const actualPath = getSnapshotPath(name, "actual", snapshotDir);
4619
4620
  const diffPath = getSnapshotPath(name, "diff", snapshotDir);
4620
4621
  const alwaysSave = process.env.ALWAYS_SAVE_SNAPSHOTS === "1";
4622
+ const updateBaseline = updateBaselineOption || process.env.UPDATE_SNAPSHOTS === "1";
4621
4623
  const actualFrames = [];
4622
4624
  for (let i = 0; i < frameCount; i++) {
4623
4625
  const frameData = await renderAndCaptureFrame(i);