@vitest/snapshot 3.2.3 → 4.0.0-beta.1

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/dist/index.d.ts CHANGED
@@ -66,13 +66,13 @@ declare class SnapshotState {
66
66
  private _unmatched;
67
67
  private _updated;
68
68
  get added(): CounterMap<string>;
69
- set added(value: number);
69
+ set added(value: CounterMap<string>);
70
70
  get matched(): CounterMap<string>;
71
- set matched(value: number);
71
+ set matched(value: CounterMap<string>);
72
72
  get unmatched(): CounterMap<string>;
73
- set unmatched(value: number);
73
+ set unmatched(value: CounterMap<string>);
74
74
  get updated(): CounterMap<string>;
75
- set updated(value: number);
75
+ set updated(value: CounterMap<string>);
76
76
  private constructor();
77
77
  static create(testFilePath: string, options: SnapshotStateOptions): Promise<SnapshotState>;
78
78
  get environment(): SnapshotEnvironment;
@@ -134,4 +134,4 @@ declare function stripSnapshotIndentation(inlineSnapshot: string): string;
134
134
  declare function addSerializer(plugin: Plugin): void;
135
135
  declare function getSerializers(): Plugins;
136
136
 
137
- export { SnapshotClient, SnapshotMatchOptions, SnapshotResult, SnapshotState, SnapshotStateOptions, addSerializer, getSerializers, stripSnapshotIndentation };
137
+ export { SnapshotClient, SnapshotEnvironment, SnapshotMatchOptions, SnapshotResult, SnapshotState, SnapshotStateOptions, addSerializer, getSerializers, stripSnapshotIndentation };
package/dist/index.js CHANGED
@@ -804,7 +804,7 @@ function parseErrorStacktrace(e, options = {}) {
804
804
  if (!e || isPrimitive(e)) {
805
805
  return [];
806
806
  }
807
- if (e.stacks) {
807
+ if ("stacks" in e && e.stacks) {
808
808
  return e.stacks;
809
809
  }
810
810
  const stackStr = e.stack || "";
@@ -845,22 +845,6 @@ catch (notNode) {
845
845
  /* ignore */
846
846
  }
847
847
 
848
- /* !
849
- * loupe
850
- * Copyright(c) 2013 Jake Luer <jake@alogicalparadox.com>
851
- * MIT Licensed
852
- */
853
- let nodeInspect = false;
854
- try {
855
- // eslint-disable-next-line global-require
856
- // @ts-ignore
857
- const nodeUtil = require('util');
858
- nodeInspect = nodeUtil.inspect ? nodeUtil.inspect.custom : false;
859
- }
860
- catch (noNodeInspect) {
861
- nodeInspect = false;
862
- }
863
-
864
848
  const { AsymmetricMatcher: AsymmetricMatcher$1, DOMCollection: DOMCollection$1, DOMElement: DOMElement$1, Immutable: Immutable$1, ReactElement: ReactElement$1, ReactTestComponent: ReactTestComponent$1 } = plugins;
865
849
 
866
850
  function getDefaultExportFromCjs (x) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/snapshot",
3
3
  "type": "module",
4
- "version": "3.2.3",
4
+ "version": "4.0.0-beta.1",
5
5
  "description": "Vitest snapshot manager",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",
@@ -40,12 +40,12 @@
40
40
  "dependencies": {
41
41
  "magic-string": "^0.30.17",
42
42
  "pathe": "^2.0.3",
43
- "@vitest/pretty-format": "3.2.3"
43
+ "@vitest/pretty-format": "4.0.0-beta.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/natural-compare": "^1.4.3",
47
47
  "natural-compare": "^1.4.0",
48
- "@vitest/utils": "3.2.3"
48
+ "@vitest/utils": "4.0.0-beta.1"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "rimraf dist && rollup -c",