@jsenv/snapshot 2.6.7 → 2.6.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/snapshot",
3
- "version": "2.6.7",
3
+ "version": "2.6.8",
4
4
  "description": "Snapshot testing",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -97,6 +97,27 @@ export const filesystemSideEffects = (
97
97
  }
98
98
  return null;
99
99
  });
100
+ addSkippableHandler((sideEffect) => {
101
+ // on llinux writing to a file with the same content
102
+ // is ignored somehow
103
+ // let's make this consistent on other platforms
104
+ if (sideEffect.code === "write_file") {
105
+ return (nextSideEffect, { skip, stop }) => {
106
+ if (
107
+ nextSideEffect.code === "write_file" &&
108
+ nextSideEffect.value.url === sideEffect.value.url &&
109
+ !Buffer.compare(
110
+ nextSideEffect.value.buffer,
111
+ sideEffect.value.buffer,
112
+ )
113
+ ) {
114
+ skip();
115
+ }
116
+ stop();
117
+ };
118
+ }
119
+ return null;
120
+ });
100
121
 
101
122
  addFinallyCallback((sideEffects) => {
102
123
  // gather all file side effect next to each other