@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.js CHANGED
@@ -4232,7 +4232,7 @@ async function expectSnapshot(pixels, options) {
4232
4232
  name,
4233
4233
  width,
4234
4234
  height,
4235
- updateBaseline = false,
4235
+ updateBaseline: updateBaselineOption = false,
4236
4236
  snapshotDir = path3.join(process.cwd(), "tests", "__snapshots__")
4237
4237
  // Default to current working dir/tests/__snapshots__
4238
4238
  } = options;
@@ -4243,6 +4243,7 @@ async function expectSnapshot(pixels, options) {
4243
4243
  const actualPath = getSnapshotPath(name, "actual", snapshotDir);
4244
4244
  const diffPath = getSnapshotPath(name, "diff", snapshotDir);
4245
4245
  const alwaysSave = process.env.ALWAYS_SAVE_SNAPSHOTS === "1";
4246
+ const updateBaseline = updateBaselineOption || process.env.UPDATE_SNAPSHOTS === "1";
4246
4247
  if (updateBaseline || !existsSync2(baselinePath)) {
4247
4248
  console.log(`Creating/Updating baseline for ${name} at ${baselinePath}`);
4248
4249
  await savePNG(pixels, width, height, baselinePath);
@@ -4332,7 +4333,7 @@ async function expectAnimationSnapshot(renderAndCaptureFrame, options) {
4332
4333
  height,
4333
4334
  frameCount,
4334
4335
  fps = 10,
4335
- updateBaseline = false,
4336
+ updateBaseline: updateBaselineOption = false,
4336
4337
  snapshotDir = path4.join(process.cwd(), "tests", "__snapshots__"),
4337
4338
  threshold = 0.1,
4338
4339
  maxDifferencePercent = 0.1
@@ -4344,6 +4345,7 @@ async function expectAnimationSnapshot(renderAndCaptureFrame, options) {
4344
4345
  const actualPath = getSnapshotPath(name, "actual", snapshotDir);
4345
4346
  const diffPath = getSnapshotPath(name, "diff", snapshotDir);
4346
4347
  const alwaysSave = process.env.ALWAYS_SAVE_SNAPSHOTS === "1";
4348
+ const updateBaseline = updateBaselineOption || process.env.UPDATE_SNAPSHOTS === "1";
4347
4349
  const actualFrames = [];
4348
4350
  for (let i = 0; i < frameCount; i++) {
4349
4351
  const frameData = await renderAndCaptureFrame(i);