@blazediff/bun 1.0.1 → 1.1.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
@@ -164,11 +164,11 @@ await expect(imageBuffer).toMatchImageSnapshot({
164
164
  ### Update Snapshots
165
165
 
166
166
  ```bash
167
- # Update all snapshots
168
- bun test -u
167
+ # Update all snapshots (recommended)
168
+ bun test --update-snapshots
169
169
 
170
- # Or
171
- bun test --update
170
+ # Or using environment variable
171
+ BUN_UPDATE_SNAPSHOTS=true bun test
172
172
  ```
173
173
 
174
174
  Or programmatically:
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=i(),c=e?.snapshotIdentifier||"snapshot",p=e?.updateSnapshots||process.env.UPDATE_SNAPSHOTS==="true"||Bun.argv.includes("-u")||Bun.argv.includes("--update"),s=await matcher.getOrCreateSnapshot(o,{method:"core",...e,updateSnapshots:p},{testPath:a,testName:c}),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 i(){if(typeof Bun<"u"&&Bun.main)return Bun.main;let n=new Error().stack;if(n){let o=n.split(`
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
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;
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=i(),c=e?.snapshotIdentifier||"snapshot",p=e?.updateSnapshots||process.env.UPDATE_SNAPSHOTS==="true"||Bun.argv.includes("-u")||Bun.argv.includes("--update"),s=await getOrCreateSnapshot(o,{method:"core",...e,updateSnapshots:p},{testPath:a,testName:c}),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 i(){if(typeof Bun<"u"&&Bun.main)return Bun.main;let n=new Error().stack;if(n){let o=n.split(`
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
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazediff/bun",
3
- "version": "1.0.1",
3
+ "version": "1.1.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.0.1"
36
+ "@blazediff/matcher": "1.1.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/bun": "^1.2.10",