@vitest/snapshot 1.0.0-beta.6 → 1.0.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.
|
@@ -7,5 +7,8 @@ interface SnapshotEnvironment {
|
|
|
7
7
|
readSnapshotFile(filepath: string): Promise<string | null>;
|
|
8
8
|
removeSnapshotFile(filepath: string): Promise<void>;
|
|
9
9
|
}
|
|
10
|
+
interface SnapshotEnvironmentOptions {
|
|
11
|
+
snapshotsDirName?: string;
|
|
12
|
+
}
|
|
10
13
|
|
|
11
|
-
export type { SnapshotEnvironment as S };
|
|
14
|
+
export type { SnapshotEnvironment as S, SnapshotEnvironmentOptions as a };
|
package/dist/environment.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { S as SnapshotEnvironment } from './environment-
|
|
1
|
+
import { S as SnapshotEnvironment, a as SnapshotEnvironmentOptions } from './environment-1emuyggI.js';
|
|
2
2
|
|
|
3
3
|
declare class NodeSnapshotEnvironment implements SnapshotEnvironment {
|
|
4
|
+
private options;
|
|
5
|
+
constructor(options?: SnapshotEnvironmentOptions);
|
|
4
6
|
getVersion(): string;
|
|
5
7
|
getHeader(): string;
|
|
6
8
|
resolveRawPath(testPath: string, rawPath: string): Promise<string>;
|
package/dist/environment.js
CHANGED
|
@@ -2,6 +2,9 @@ import { promises, existsSync } from 'node:fs';
|
|
|
2
2
|
import { isAbsolute, resolve, dirname, join, basename } from 'pathe';
|
|
3
3
|
|
|
4
4
|
class NodeSnapshotEnvironment {
|
|
5
|
+
constructor(options = {}) {
|
|
6
|
+
this.options = options;
|
|
7
|
+
}
|
|
5
8
|
getVersion() {
|
|
6
9
|
return "1";
|
|
7
10
|
}
|
|
@@ -15,7 +18,7 @@ class NodeSnapshotEnvironment {
|
|
|
15
18
|
return join(
|
|
16
19
|
join(
|
|
17
20
|
dirname(filepath),
|
|
18
|
-
"__snapshots__"
|
|
21
|
+
this.options.snapshotsDirName ?? "__snapshots__"
|
|
19
22
|
),
|
|
20
23
|
`${basename(filepath)}.snap`
|
|
21
24
|
);
|
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-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';
|
|
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-
|
|
1
|
+
import { S as SnapshotStateOptions, e as SnapshotSummary, b as SnapshotResult } from './index-K5cwkiJB.js';
|
|
2
2
|
import 'pretty-format';
|
|
3
|
-
import './environment-
|
|
3
|
+
import './environment-1emuyggI.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.0.0
|
|
4
|
+
"version": "1.0.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.0.0
|
|
48
|
+
"@vitest/utils": "1.0.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "rimraf dist && rollup -c",
|