vitest-plugin-vis 1.3.1 → 1.3.2
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/esm/client/expect/to_match_image_snapshot.js +1 -1
- package/esm/client/{match_image_snapshot.d.ts → image_snapshot_matcher.d.ts} +1 -1
- package/esm/client/image_snapshot_matcher.d.ts.map +1 -0
- package/esm/client/{match_image_snapshot.js → image_snapshot_matcher.js} +2 -2
- package/esm/client/{match_image_snapshot.logic.d.ts → image_snapshot_matcher.logic.d.ts} +1 -1
- package/esm/client/image_snapshot_matcher.logic.d.ts.map +1 -0
- package/esm/client.d.ts +1 -1
- package/esm/client.d.ts.map +1 -1
- package/esm/client.js +1 -1
- package/package.json +1 -1
- package/src/client/expect/to_match_image_snapshot.ts +1 -1
- package/src/client/{match_image_snapshot.ts → image_snapshot_matcher.ts} +2 -2
- package/src/client.ts +1 -1
- package/esm/client/match_image_snapshot.d.ts.map +0 -1
- package/esm/client/match_image_snapshot.logic.d.ts.map +0 -1
- /package/esm/client/{match_image_snapshot.logic.js → image_snapshot_matcher.logic.js} +0 -0
- /package/src/client/{match_image_snapshot.logic.ts → image_snapshot_matcher.logic.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { commands } from '@vitest/browser/context';
|
|
2
2
|
import { ctx } from "../ctx.js";
|
|
3
|
-
import { imageSnapshotMatcher } from "../
|
|
3
|
+
import { imageSnapshotMatcher } from "../image_snapshot_matcher.js";
|
|
4
4
|
import { success } from "./expectation_result.js";
|
|
5
5
|
export function toMatchImageSnapshot(
|
|
6
6
|
/**
|
|
@@ -8,4 +8,4 @@ export declare function imageSnapshotMatcher(commands: PrepareImageSnapshotCompa
|
|
|
8
8
|
* @deprecated internalized. Use `matchImageSnapshot` directly instead.
|
|
9
9
|
*/
|
|
10
10
|
export declare function parseImageSnapshotSubject(subject: any): any;
|
|
11
|
-
//# sourceMappingURL=
|
|
11
|
+
//# sourceMappingURL=image_snapshot_matcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image_snapshot_matcher.d.ts","sourceRoot":"","sources":["../../src/client/image_snapshot_matcher.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,yDAAyD,CAAA;AACpH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAA;AAI3F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAA;AAO5F,wBAAgB,oBAAoB,CACnC,QAAQ,EAAE,qCAAqC,GAAG,yBAAyB,GAAG,6BAA6B,UAE5D,IAAI,WAAW,GAAG,YAAY,2BAA2B,mBA8DxG;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,GAAG,OAOrD"}
|
|
@@ -4,7 +4,7 @@ import { isBase64String } from "../shared/base64.js";
|
|
|
4
4
|
import { compareImage } from "../shared/compare_image.js";
|
|
5
5
|
import { alignImagesToSameSize } from "./align_images.js";
|
|
6
6
|
import { toDataURL, toImageData } from "./image_data.js";
|
|
7
|
-
import { prettifyOptions } from "./
|
|
7
|
+
import { prettifyOptions } from "./image_snapshot_matcher.logic.js";
|
|
8
8
|
import { convertElementToCssSelector } from "./selector.js";
|
|
9
9
|
import { toTaskId } from "./task_id.js";
|
|
10
10
|
import { server } from "./vitest_browser_context_proxy.js";
|
|
@@ -25,7 +25,7 @@ export function imageSnapshotMatcher(commands) {
|
|
|
25
25
|
throw new Error(dedent `Snapshot \`${taskId}\` matched but expected to fail.
|
|
26
26
|
|
|
27
27
|
Options: ${prettifyOptions(options)}
|
|
28
|
-
|
|
28
|
+
Diff: ${options.failureThresholdType === 'percent' ? `${diffAmount}%` : `${diffAmount} pixels`}
|
|
29
29
|
|
|
30
30
|
Expected: ${resolve(info.projectRoot, info.baselinePath)}
|
|
31
31
|
Actual: ${resolve(info.projectRoot, info.resultPath)}`);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ToMatchImageSnapshotOptions } from './expect/to_match_image_snapshot.types.ts';
|
|
2
2
|
export declare function prettifyOptions(options: ToMatchImageSnapshotOptions | undefined): string;
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=image_snapshot_matcher.logic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image_snapshot_matcher.logic.d.ts","sourceRoot":"","sources":["../../src/client/image_snapshot_matcher.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAA;AAE5F,wBAAgB,eAAe,CAAC,OAAO,EAAE,2BAA2B,GAAG,SAAS,UAU/E"}
|
package/esm/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './client/expect/expectation_result.ts';
|
|
2
2
|
export type * from './client/expect/to_match_image_snapshot.types.ts';
|
|
3
|
-
export * from './client/
|
|
3
|
+
export * from './client/image_snapshot_matcher.ts';
|
|
4
4
|
export * from './client/should_take_snapshot.ts';
|
|
5
5
|
export * from './client/snapshot_options.ts';
|
|
6
6
|
export * from './client/task_id.ts';
|
package/esm/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAA;AACrD,mBAAmB,kDAAkD,CAAA;AACrE,cAAc,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAA;AACrD,mBAAmB,kDAAkD,CAAA;AACrE,cAAc,oCAAoC,CAAA;AAClD,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,qBAAqB,CAAA;AACnC,mBAAmB,mBAAmB,CAAA"}
|
package/esm/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./client/expect/expectation_result.js";
|
|
2
|
-
export * from "./client/
|
|
2
|
+
export * from "./client/image_snapshot_matcher.js";
|
|
3
3
|
export * from "./client/should_take_snapshot.js";
|
|
4
4
|
export * from "./client/snapshot_options.js";
|
|
5
5
|
export * from "./client/task_id.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { commands } from '@vitest/browser/context'
|
|
2
2
|
import type { AsyncExpectationResult } from '@vitest/expect'
|
|
3
3
|
import { ctx } from '../ctx.ts'
|
|
4
|
-
import { imageSnapshotMatcher } from '../
|
|
4
|
+
import { imageSnapshotMatcher } from '../image_snapshot_matcher.ts'
|
|
5
5
|
import { success } from './expectation_result.ts'
|
|
6
6
|
import type { ToMatchImageSnapshotOptions } from './to_match_image_snapshot.types.ts'
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@ import { compareImage } from '../shared/compare_image.ts'
|
|
|
9
9
|
import { alignImagesToSameSize } from './align_images.ts'
|
|
10
10
|
import type { ToMatchImageSnapshotOptions } from './expect/to_match_image_snapshot.types.ts'
|
|
11
11
|
import { toDataURL, toImageData } from './image_data.ts'
|
|
12
|
-
import { prettifyOptions } from './
|
|
12
|
+
import { prettifyOptions } from './image_snapshot_matcher.logic.ts'
|
|
13
13
|
import { convertElementToCssSelector } from './selector.ts'
|
|
14
14
|
import { toTaskId } from './task_id.ts'
|
|
15
15
|
import { server } from './vitest_browser_context_proxy.ts'
|
|
@@ -46,7 +46,7 @@ export function imageSnapshotMatcher(
|
|
|
46
46
|
dedent`Snapshot \`${taskId}\` matched but expected to fail.
|
|
47
47
|
|
|
48
48
|
Options: ${prettifyOptions(options)}
|
|
49
|
-
|
|
49
|
+
Diff: ${options.failureThresholdType === 'percent' ? `${diffAmount}%` : `${diffAmount} pixels`}
|
|
50
50
|
|
|
51
51
|
Expected: ${resolve(info.projectRoot, info.baselinePath)}
|
|
52
52
|
Actual: ${resolve(info.projectRoot, info.resultPath)}`,
|
package/src/client.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './client/expect/expectation_result.ts'
|
|
2
2
|
export type * from './client/expect/to_match_image_snapshot.types.ts'
|
|
3
|
-
export * from './client/
|
|
3
|
+
export * from './client/image_snapshot_matcher.ts'
|
|
4
4
|
export * from './client/should_take_snapshot.ts'
|
|
5
5
|
export * from './client/snapshot_options.ts'
|
|
6
6
|
export * from './client/task_id.ts'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"match_image_snapshot.d.ts","sourceRoot":"","sources":["../../src/client/match_image_snapshot.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,yDAAyD,CAAA;AACpH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAA;AAI3F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAA;AAO5F,wBAAgB,oBAAoB,CACnC,QAAQ,EAAE,qCAAqC,GAAG,yBAAyB,GAAG,6BAA6B,UAE5D,IAAI,WAAW,GAAG,YAAY,2BAA2B,mBA8DxG;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,GAAG,OAOrD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"match_image_snapshot.logic.d.ts","sourceRoot":"","sources":["../../src/client/match_image_snapshot.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAA;AAE5F,wBAAgB,eAAe,CAAC,OAAO,EAAE,2BAA2B,GAAG,SAAS,UAU/E"}
|
|
File without changes
|
|
File without changes
|