@jsenv/snapshot 2.18.8 → 2.18.9

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.18.8",
3
+ "version": "2.18.9",
4
4
  "type": "module",
5
5
  "description": "Snapshot testing",
6
6
  "repository": {
@@ -64,6 +64,14 @@ export const replaceFluctuatingValues = (
64
64
  });
65
65
  return string;
66
66
  };
67
+ // node prefixes the warnings it emits with the pid, as in
68
+ // "(node:9356) [DEP0205] DeprecationWarning: ..."
69
+ const replaceProcessIds = (string) => {
70
+ string = string.replace(/\(node:\d+\)/g, () => {
71
+ return "(node:<X>)";
72
+ });
73
+ return string;
74
+ };
67
75
  const replaceSizes = (string) => {
68
76
  // the size of files might slighly differ from an OS to an other
69
77
  // we round the floats to make them predictable
@@ -93,6 +101,7 @@ export const replaceFluctuatingValues = (
93
101
  return replaceFilesystemWellKnownValues(string);
94
102
  }
95
103
  string = replaceTimestamps(string);
104
+ string = replaceProcessIds(string);
96
105
  if (!preserveAnsi) {
97
106
  string = stripAnsi(string);
98
107
  }