@blazediff/vitest 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,6 +164,9 @@ vitest -u
164
164
 
165
165
  # Update snapshots for specific test
166
166
  vitest -u path/to/test.spec.ts
167
+
168
+ # Or using environment variable
169
+ VITEST_UPDATE_SNAPSHOTS=true vitest
167
170
  ```
168
171
 
169
172
  Or programmatically:
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var matcher=require('@blazediff/matcher'),vitest=require('vitest');function n(){vitest.expect.extend({async toMatchImageSnapshot(r,s){let p=this.testPath||"",a=this.currentTestName||"unknown",t=this.snapshotState,c=s?.updateSnapshots||t?._updateSnapshot==="all"||process.env.UPDATE_SNAPSHOTS==="true",e=await matcher.getOrCreateSnapshot(r,{method:"core",...s,updateSnapshots:c},{testPath:p,testName:a});if(t&&e.snapshotStatus)switch(e.snapshotStatus){case "added":t.added.increment(a),t._dirty=true;break;case "updated":t.updated.increment(a),t._dirty=true;break;case "matched":t.matched.increment(a);break;case "failed":t.unmatched.increment(a);break}return {pass:e.pass,message:()=>e.message,actual:e.receivedPath,expected:e.baselinePath}}});}n();var m=n;exports.default=m;exports.setupBlazediffMatchers=n;
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var matcher=require('@blazediff/matcher'),vitest=require('vitest');function n(){vitest.expect.extend({async toMatchImageSnapshot(r,s){let p=this.testPath||"",a=this.currentTestName||"unknown",t=this.snapshotState,o=s?.updateSnapshots??t?._updateSnapshot??(process.env.VITEST_UPDATE_SNAPSHOTS==="true"||"new"),e=await matcher.getOrCreateSnapshot(r,{method:"core",...s,updateSnapshots:o,updateCommand:"-u or VITEST_UPDATE_SNAPSHOTS=true"},{testPath:p,testName:a});if(t&&e.snapshotStatus)switch(e.snapshotStatus){case "added":t.added.increment(a),t._dirty=true;break;case "updated":t.updated.increment(a),t._dirty=true;break;case "matched":t.matched.increment(a);break;case "failed":t.unmatched.increment(a);break}return {pass:e.pass,message:()=>e.message,actual:e.receivedPath,expected:e.baselinePath}}});}n();var m=n;exports.default=m;exports.setupBlazediffMatchers=n;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import {getOrCreateSnapshot}from'@blazediff/matcher';import {expect}from'vitest';function n(){expect.extend({async toMatchImageSnapshot(r,s){let p=this.testPath||"",a=this.currentTestName||"unknown",t=this.snapshotState,c=s?.updateSnapshots||t?._updateSnapshot==="all"||process.env.UPDATE_SNAPSHOTS==="true",e=await getOrCreateSnapshot(r,{method:"core",...s,updateSnapshots:c},{testPath:p,testName:a});if(t&&e.snapshotStatus)switch(e.snapshotStatus){case "added":t.added.increment(a),t._dirty=true;break;case "updated":t.updated.increment(a),t._dirty=true;break;case "matched":t.matched.increment(a);break;case "failed":t.unmatched.increment(a);break}return {pass:e.pass,message:()=>e.message,actual:e.receivedPath,expected:e.baselinePath}}});}n();var m=n;export{m as default,n as setupBlazediffMatchers};
1
+ import {getOrCreateSnapshot}from'@blazediff/matcher';import {expect}from'vitest';function n(){expect.extend({async toMatchImageSnapshot(r,s){let p=this.testPath||"",a=this.currentTestName||"unknown",t=this.snapshotState,o=s?.updateSnapshots??t?._updateSnapshot??(process.env.VITEST_UPDATE_SNAPSHOTS==="true"||"new"),e=await getOrCreateSnapshot(r,{method:"core",...s,updateSnapshots:o,updateCommand:"-u or VITEST_UPDATE_SNAPSHOTS=true"},{testPath:p,testName:a});if(t&&e.snapshotStatus)switch(e.snapshotStatus){case "added":t.added.increment(a),t._dirty=true;break;case "updated":t.updated.increment(a),t._dirty=true;break;case "matched":t.matched.increment(a);break;case "failed":t.unmatched.increment(a);break}return {pass:e.pass,message:()=>e.message,actual:e.receivedPath,expected:e.baselinePath}}});}n();var m=n;export{m as default,n as setupBlazediffMatchers};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazediff/vitest",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Vitest 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/node": "^24.3.0",