@vitest/snapshot 1.2.2 → 1.3.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/LICENSE +1 -2
- package/README.md +1 -1
- package/dist/environment-cMiGIVXz.d.ts +14 -0
- package/dist/environment.d.ts +1 -1
- package/dist/{index-K5cwkiJB.d.ts → index-S94ASl6q.d.ts} +4 -3
- package/dist/index.d.ts +3 -3
- package/dist/manager.d.ts +2 -2
- package/package.json +2 -2
- package/dist/environment-1emuyggI.d.ts +0 -14
package/LICENSE
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2021-Present
|
|
4
|
-
Copyright (c) 2021-Present Matias Capeletto <https://github.com/patak-dev>
|
|
3
|
+
Copyright (c) 2021-Present Vitest Team
|
|
5
4
|
|
|
6
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -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 };
|
package/dist/environment.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SnapshotEnvironment, a as SnapshotEnvironmentOptions } from './environment-
|
|
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-
|
|
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,
|
|
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-
|
|
2
|
-
export { c as SnapshotData, e as SnapshotSummary, d as SnapshotUpdateState, U as UncheckedSnapshot } from './index-
|
|
3
|
-
import { S as SnapshotEnvironment } from './environment-
|
|
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,
|
|
1
|
+
import { S as SnapshotStateOptions, f as SnapshotSummary, b as SnapshotResult } from './index-S94ASl6q.js';
|
|
2
2
|
import 'pretty-format';
|
|
3
|
-
import './environment-
|
|
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.
|
|
4
|
+
"version": "1.3.1",
|
|
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.
|
|
48
|
+
"@vitest/utils": "1.3.1"
|
|
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 };
|