@blazediff/bun 1.1.9 → 1.2.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.
package/README.md CHANGED
@@ -117,6 +117,12 @@ Bun test matcher for image snapshot comparison.
117
117
  <td>true</td>
118
118
  <td>Run comparison in worker thread for better performance</td>
119
119
  </tr>
120
+ <tr>
121
+ <td><code>outputFormat</code></td>
122
+ <td>'png' | 'html'</td>
123
+ <td>'png'</td>
124
+ <td>Diff output format (<code>core-native</code> only). Use <code>'html'</code> for an interactive interpret report with detected change regions, classification, and severity</td>
125
+ </tr>
120
126
  </table>
121
127
 
122
128
  See [@blazediff/matcher](https://www.npmjs.com/package/@blazediff/matcher) for full options documentation.
@@ -187,6 +193,21 @@ await expect(screenshot).toMatchImageSnapshot({
187
193
  });
188
194
  ```
189
195
 
196
+ ### HTML Interpret Report
197
+
198
+ When using `core-native`, set `outputFormat: 'html'` to generate an interactive HTML report on failure instead of a plain diff image. The report includes detected change regions with classification, severity, and spatial analysis.
199
+
200
+ ```typescript
201
+ await expect('/path/to/image.png').toMatchImageSnapshot({
202
+ method: 'core-native',
203
+ outputFormat: 'html',
204
+ snapshotIdentifier: 'homepage',
205
+ });
206
+
207
+ // On failure, the diff file will be .html instead of .png
208
+ // e.g., __snapshots__/homepage.diff.html
209
+ ```
210
+
190
211
  ### Custom Thresholds
191
212
 
192
213
  ```typescript
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var bun_test=require('bun:test'),matcher=require('@blazediff/matcher');function r(){bun_test.expect.extend({toMatchImageSnapshot:async function(o,e){let a=h(),p=e?.snapshotIdentifier||"snapshot",c=e?.updateSnapshots||process.env.BUN_UPDATE_SNAPSHOTS==="true"||Bun.argv.includes("-u")||Bun.argv.includes("--update-snapshots"),s=await matcher.getOrCreateSnapshot(o,{method:"core",...e,updateSnapshots:c,updateCommand:"--update-snapshots or BUN_UPDATE_SNAPSHOTS=true"},{testPath:a,testName:p}),t=this.snapshotState;if(t&&s.snapshotStatus)switch(s.snapshotStatus){case "added":t.added=(t.added||0)+1;break;case "updated":t.updated=(t.updated||0)+1;break;case "matched":t.matched=(t.matched||0)+1;break;case "failed":t.unmatched=(t.unmatched||0)+1;break}return {pass:s.pass,message:()=>s.message}}});}function h(){if(typeof Bun<"u"&&Bun.main)return Bun.main;let n=new Error().stack;if(n){let o=n.split(`
2
- `);for(let e of o){let a=e.match(/at\s+(.+\.test\.[tj]s)/);if(a)return a[1]}}return "unknown"}r();var f=r;exports.default=f;exports.setupBlazediffMatchers=r;
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var bun_test=require('bun:test'),matcher=require('@blazediff/matcher');function r(){bun_test.expect.extend({toMatchImageSnapshot:async function(o,a){let e=h(),p=a?.snapshotIdentifier||"snapshot",c=a?.updateSnapshots||process.env.BUN_UPDATE_SNAPSHOTS==="true"||Bun.argv.includes("-u")||Bun.argv.includes("--update-snapshots"),s=await matcher.getOrCreateSnapshot(o,{method:"core",...a,updateSnapshots:c,updateCommand:"--update-snapshots or BUN_UPDATE_SNAPSHOTS=true"},{testPath:e,testName:p}),t=this.snapshotState;if(t&&s.snapshotStatus)switch(s.snapshotStatus){case "added":t.added=(t.added||0)+1;break;case "updated":t.updated=(t.updated||0)+1;break;case "matched":t.matched=(t.matched||0)+1;break;case "failed":t.unmatched=(t.unmatched||0)+1;break}return {pass:s.pass,message:()=>s.message}}});}function h(){if(Bun?.main)return Bun.main;let n=new Error().stack;if(n){let o=n.split(`
2
+ `);for(let a of o){let e=a.match(/at\s+(.+\.test\.[tj]s)/);if(e)return e[1]}}return "unknown"}r();var f=r;exports.default=f;exports.setupBlazediffMatchers=r;
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import {expect}from'bun:test';import {getOrCreateSnapshot}from'@blazediff/matcher';function r(){expect.extend({toMatchImageSnapshot:async function(o,e){let a=h(),p=e?.snapshotIdentifier||"snapshot",c=e?.updateSnapshots||process.env.BUN_UPDATE_SNAPSHOTS==="true"||Bun.argv.includes("-u")||Bun.argv.includes("--update-snapshots"),s=await getOrCreateSnapshot(o,{method:"core",...e,updateSnapshots:c,updateCommand:"--update-snapshots or BUN_UPDATE_SNAPSHOTS=true"},{testPath:a,testName:p}),t=this.snapshotState;if(t&&s.snapshotStatus)switch(s.snapshotStatus){case "added":t.added=(t.added||0)+1;break;case "updated":t.updated=(t.updated||0)+1;break;case "matched":t.matched=(t.matched||0)+1;break;case "failed":t.unmatched=(t.unmatched||0)+1;break}return {pass:s.pass,message:()=>s.message}}});}function h(){if(typeof Bun<"u"&&Bun.main)return Bun.main;let n=new Error().stack;if(n){let o=n.split(`
2
- `);for(let e of o){let a=e.match(/at\s+(.+\.test\.[tj]s)/);if(a)return a[1]}}return "unknown"}r();var f=r;export{f as default,r as setupBlazediffMatchers};
1
+ import {expect}from'bun:test';import {getOrCreateSnapshot}from'@blazediff/matcher';function r(){expect.extend({toMatchImageSnapshot:async function(o,a){let e=h(),p=a?.snapshotIdentifier||"snapshot",c=a?.updateSnapshots||process.env.BUN_UPDATE_SNAPSHOTS==="true"||Bun.argv.includes("-u")||Bun.argv.includes("--update-snapshots"),s=await getOrCreateSnapshot(o,{method:"core",...a,updateSnapshots:c,updateCommand:"--update-snapshots or BUN_UPDATE_SNAPSHOTS=true"},{testPath:e,testName:p}),t=this.snapshotState;if(t&&s.snapshotStatus)switch(s.snapshotStatus){case "added":t.added=(t.added||0)+1;break;case "updated":t.updated=(t.updated||0)+1;break;case "matched":t.matched=(t.matched||0)+1;break;case "failed":t.unmatched=(t.unmatched||0)+1;break}return {pass:s.pass,message:()=>s.message}}});}function h(){if(Bun?.main)return Bun.main;let n=new Error().stack;if(n){let o=n.split(`
2
+ `);for(let a of o){let e=a.match(/at\s+(.+\.test\.[tj]s)/);if(e)return e[1]}}return "unknown"}r();var f=r;export{f as default,r as setupBlazediffMatchers};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazediff/bun",
3
- "version": "1.1.9",
3
+ "version": "1.2.1",
4
4
  "description": "Bun test matcher for visual regression testing with blazediff",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -33,7 +33,7 @@
33
33
  "homepage": "https://blazediff.dev",
34
34
  "license": "MIT",
35
35
  "dependencies": {
36
- "@blazediff/matcher": "1.3.1"
36
+ "@blazediff/matcher": "1.4.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/bun": "^1.2.10",