@blazediff/bun 1.1.8 → 1.2.0

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
@@ -13,7 +13,7 @@ Bun test matcher for visual regression testing with blazediff. Powered by @blaze
13
13
 
14
14
  - **Native Bun matcher**: `toMatchImageSnapshot()` extends Bun's expect
15
15
  - **Snapshot state tracking**: Bun reports accurate snapshot counts (when API available)
16
- - **Multiple comparison algorithms**: `core`, `bin`, `ssim`, `msssim`, `hitchhikers-ssim`, `gmsd`
16
+ - **Multiple comparison algorithms**: `core`, `core-native`, `ssim`, `msssim`, `hitchhikers-ssim`, `gmsd`
17
17
  - **Auto-setup**: Imports and registers automatically
18
18
  - **Update mode**: Works with Bun's `-u`/`--update` flag
19
19
  - **TypeScript support**: Full type definitions included
@@ -71,7 +71,7 @@ Bun test matcher for image snapshot comparison.
71
71
  </tr>
72
72
  <tr>
73
73
  <td><code>method</code></td>
74
- <td>'core' | 'bin' | 'ssim' | 'msssim' | 'hitchhikers-ssim' | 'gmsd'</td>
74
+ <td>'core' | 'core-native' | 'ssim' | 'msssim' | 'hitchhikers-ssim' | 'gmsd'</td>
75
75
  <td>'core'</td>
76
76
  <td>Comparison algorithm to use</td>
77
77
  </tr>
@@ -109,7 +109,7 @@ Bun test matcher for image snapshot comparison.
109
109
  <td><code>threshold</code></td>
110
110
  <td>number</td>
111
111
  <td>0.1</td>
112
- <td>Color difference threshold (0-1) for core/bin methods</td>
112
+ <td>Color difference threshold (0-1) for core/core-native methods</td>
113
113
  </tr>
114
114
  <tr>
115
115
  <td><code>runInWorker</code></td>
@@ -144,8 +144,8 @@ it('renders correctly', async () => {
144
144
  ```typescript
145
145
  // Fast Rust-native comparison (file paths only)
146
146
  await expect('/path/to/image.png').toMatchImageSnapshot({
147
- method: 'bin',
148
- snapshotIdentifier: 'image-bin',
147
+ method: 'core-native',
148
+ snapshotIdentifier: 'image-core-native',
149
149
  });
150
150
 
151
151
  // Pure JavaScript comparison
package/dist/index.d.ts CHANGED
@@ -15,7 +15,7 @@ declare module "bun:test" {
15
15
  * ```typescript
16
16
  * // Compare file path
17
17
  * await expect('/path/to/screenshot.png').toMatchImageSnapshot({
18
- * method: 'bin',
18
+ * method: 'core-native',
19
19
  * failureThreshold: 100,
20
20
  * failureThresholdType: 'pixel',
21
21
  * });
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.8",
3
+ "version": "1.2.0",
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.0"
36
+ "@blazediff/matcher": "1.4.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/bun": "^1.2.10",