vitest-plugin-vis 1.5.0 → 1.5.1

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.
@@ -41,8 +41,8 @@ export const matchImageSnapshot = async (context, taskId, subject, options) => {
41
41
 
42
42
  The image size changed form ${baselineImage.width}x${baselineImage.height} to ${resultImage.width}x${resultImage.height}
43
43
 
44
- Expected: ${resolve(context.project.runner.root, info.baselinePath)}
45
- Actual: ${resolve(context.project.runner.root, info.resultPath)}`);
44
+ Expected: ${resolve(context.project.config.root, info.baselinePath)}
45
+ Actual: ${resolve(context.project.config.root, info.resultPath)}`);
46
46
  }
47
47
  if (context.project.config.snapshotOptions.updateSnapshot === 'all') {
48
48
  await writeSnapshotBuffer(info.baselinePath, resultImage.data);
@@ -59,9 +59,9 @@ export const matchImageSnapshot = async (context, taskId, subject, options) => {
59
59
 
60
60
  Options: ${JSON.stringify(options)}
61
61
 
62
- Expected: ${resolve(context.project.runner.root, info.baselinePath)}
63
- Actual: ${resolve(context.project.runner.root, info.resultPath)}
64
- Difference: ${resolve(context.project.runner.root, info.diffPath)}`);
62
+ Expected: ${resolve(context.project.config.root, info.baselinePath)}
63
+ Actual: ${resolve(context.project.config.root, info.resultPath)}
64
+ Difference: ${resolve(context.project.config.root, info.diffPath)}`);
65
65
  };
66
66
  function alignImageSizes(baseline, result) {
67
67
  if (isSameSize(baseline, result))
@@ -23,7 +23,7 @@ export const prepareImageSnapshotComparison = async (context, taskId, subject, o
23
23
  const resultBuffer = await takeSnapshot(context, info.resultPath, subject, options);
24
24
  return {
25
25
  ...info,
26
- projectRoot: context.project.runner.root,
26
+ projectRoot: context.project.config.root,
27
27
  baseline: baselineBuffer.toString('base64'),
28
28
  result: resultBuffer.toString('base64'),
29
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest-plugin-vis",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Vitest visual testing plugin",
5
5
  "keywords": [
6
6
  "image-snapshot",
@@ -76,8 +76,8 @@ export const matchImageSnapshot: BrowserCommand<
76
76
 
77
77
  The image size changed form ${baselineImage.width}x${baselineImage.height} to ${resultImage.width}x${resultImage.height}
78
78
 
79
- Expected: ${resolve(context.project.runner.root, info.baselinePath)}
80
- Actual: ${resolve(context.project.runner.root, info.resultPath)}`,
79
+ Expected: ${resolve(context.project.config.root, info.baselinePath)}
80
+ Actual: ${resolve(context.project.config.root, info.resultPath)}`,
81
81
  )
82
82
  }
83
83
 
@@ -101,9 +101,9 @@ export const matchImageSnapshot: BrowserCommand<
101
101
 
102
102
  Options: ${JSON.stringify(options)}
103
103
 
104
- Expected: ${resolve(context.project.runner.root, info.baselinePath)}
105
- Actual: ${resolve(context.project.runner.root, info.resultPath)}
106
- Difference: ${resolve(context.project.runner.root, info.diffPath)}`,
104
+ Expected: ${resolve(context.project.config.root, info.baselinePath)}
105
+ Actual: ${resolve(context.project.config.root, info.resultPath)}
106
+ Difference: ${resolve(context.project.config.root, info.diffPath)}`,
107
107
  )
108
108
  }
109
109
 
@@ -54,7 +54,7 @@ export const prepareImageSnapshotComparison: BrowserCommand<
54
54
  const resultBuffer = await takeSnapshot(context, info.resultPath, subject, options)
55
55
  return {
56
56
  ...info,
57
- projectRoot: context.project.runner.root,
57
+ projectRoot: context.project.config.root,
58
58
  baseline: baselineBuffer.toString('base64'),
59
59
  result: resultBuffer.toString('base64'),
60
60
  }