@vitest/snapshot 1.2.2 → 1.3.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
@@ -76,4 +76,4 @@ manager.add(result)
76
76
  // and then read the summary
77
77
 
78
78
  console.log(manager.summary)
79
- ```
79
+ ```
@@ -0,0 +1,14 @@
1
+ interface SnapshotEnvironment {
2
+ getVersion: () => string;
3
+ getHeader: () => string;
4
+ resolvePath: (filepath: string) => Promise<string>;
5
+ resolveRawPath: (testPath: string, rawPath: string) => Promise<string>;
6
+ saveSnapshotFile: (filepath: string, snapshot: string) => Promise<void>;
7
+ readSnapshotFile: (filepath: string) => Promise<string | null>;
8
+ removeSnapshotFile: (filepath: string) => Promise<void>;
9
+ }
10
+ interface SnapshotEnvironmentOptions {
11
+ snapshotsDirName?: string;
12
+ }
13
+
14
+ export type { SnapshotEnvironment as S, SnapshotEnvironmentOptions as a };
@@ -1,4 +1,4 @@
1
- import { S as SnapshotEnvironment, a as SnapshotEnvironmentOptions } from './environment-1emuyggI.js';
1
+ import { S as SnapshotEnvironment, a as SnapshotEnvironmentOptions } from './environment-cMiGIVXz.js';
2
2
 
3
3
  declare class NodeSnapshotEnvironment implements SnapshotEnvironment {
4
4
  private options;
@@ -1,5 +1,5 @@
1
- import { OptionsReceived } from 'pretty-format';
2
- import { S as SnapshotEnvironment } from './environment-1emuyggI.js';
1
+ import { Plugin, OptionsReceived } from 'pretty-format';
2
+ import { S as SnapshotEnvironment } from './environment-cMiGIVXz.js';
3
3
 
4
4
  interface RawSnapshotInfo {
5
5
  file: string;
@@ -9,6 +9,7 @@ interface RawSnapshotInfo {
9
9
 
10
10
  type SnapshotData = Record<string, string>;
11
11
  type SnapshotUpdateState = 'all' | 'new' | 'none';
12
+ type SnapshotSerializer = Plugin;
12
13
  interface SnapshotStateOptions {
13
14
  updateSnapshot: SnapshotUpdateState;
14
15
  snapshotEnvironment: SnapshotEnvironment;
@@ -56,4 +57,4 @@ interface SnapshotSummary {
56
57
  updated: number;
57
58
  }
58
59
 
59
- export type { RawSnapshotInfo as R, SnapshotStateOptions as S, UncheckedSnapshot as U, SnapshotMatchOptions as a, SnapshotResult as b, SnapshotData as c, SnapshotUpdateState as d, SnapshotSummary as e };
60
+ export type { RawSnapshotInfo as R, SnapshotStateOptions as S, UncheckedSnapshot as U, SnapshotMatchOptions as a, SnapshotResult as b, SnapshotData as c, SnapshotUpdateState as d, SnapshotSerializer as e, SnapshotSummary as f };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { S as SnapshotStateOptions, a as SnapshotMatchOptions, b as SnapshotResult, R as RawSnapshotInfo } from './index-K5cwkiJB.js';
2
- export { c as SnapshotData, e as SnapshotSummary, d as SnapshotUpdateState, U as UncheckedSnapshot } from './index-K5cwkiJB.js';
3
- import { S as SnapshotEnvironment } from './environment-1emuyggI.js';
1
+ import { S as SnapshotStateOptions, a as SnapshotMatchOptions, b as SnapshotResult, R as RawSnapshotInfo } from './index-S94ASl6q.js';
2
+ export { c as SnapshotData, e as SnapshotSerializer, f as SnapshotSummary, d as SnapshotUpdateState, U as UncheckedSnapshot } from './index-S94ASl6q.js';
3
+ import { S as SnapshotEnvironment } from './environment-cMiGIVXz.js';
4
4
  import { Plugin, Plugins } from 'pretty-format';
5
5
 
6
6
  interface ParsedStack {
package/dist/manager.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { S as SnapshotStateOptions, e as SnapshotSummary, b as SnapshotResult } from './index-K5cwkiJB.js';
1
+ import { S as SnapshotStateOptions, f as SnapshotSummary, b as SnapshotResult } from './index-S94ASl6q.js';
2
2
  import 'pretty-format';
3
- import './environment-1emuyggI.js';
3
+ import './environment-cMiGIVXz.js';
4
4
 
5
5
  declare class SnapshotManager {
6
6
  options: Omit<SnapshotStateOptions, 'snapshotEnvironment'>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/snapshot",
3
3
  "type": "module",
4
- "version": "1.2.2",
4
+ "version": "1.3.0",
5
5
  "description": "Vitest snapshot manager",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@types/natural-compare": "^1.4.3",
47
47
  "natural-compare": "^1.4.0",
48
- "@vitest/utils": "1.2.2"
48
+ "@vitest/utils": "1.3.0"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "rimraf dist && rollup -c",
@@ -1,14 +0,0 @@
1
- interface SnapshotEnvironment {
2
- getVersion(): string;
3
- getHeader(): string;
4
- resolvePath(filepath: string): Promise<string>;
5
- resolveRawPath(testPath: string, rawPath: string): Promise<string>;
6
- saveSnapshotFile(filepath: string, snapshot: string): Promise<void>;
7
- readSnapshotFile(filepath: string): Promise<string | null>;
8
- removeSnapshotFile(filepath: string): Promise<void>;
9
- }
10
- interface SnapshotEnvironmentOptions {
11
- snapshotsDirName?: string;
12
- }
13
-
14
- export type { SnapshotEnvironment as S, SnapshotEnvironmentOptions as a };