vitest-plugin-vis 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.
Files changed (204) hide show
  1. package/esm/client/ctx.d.ts +6 -0
  2. package/esm/client/ctx.d.ts.map +1 -0
  3. package/esm/client/ctx.js +7 -0
  4. package/esm/client/expect/expectation_result.d.ts +3 -0
  5. package/esm/client/expect/expectation_result.d.ts.map +1 -0
  6. package/esm/client/expect/expectation_result.js +5 -0
  7. package/esm/client/expect/extend.d.ts +8 -0
  8. package/esm/client/expect/extend.d.ts.map +1 -0
  9. package/esm/client/expect/extend.js +3 -0
  10. package/esm/client/expect/to_match_image_snapshot.d.ts +9 -0
  11. package/esm/client/expect/to_match_image_snapshot.d.ts.map +1 -0
  12. package/esm/client/expect/to_match_image_snapshot.js +32 -0
  13. package/esm/client/expect/to_match_image_snapshot.logic.d.ts +2 -0
  14. package/esm/client/expect/to_match_image_snapshot.logic.d.ts.map +1 -0
  15. package/esm/client/expect/to_match_image_snapshot.logic.js +11 -0
  16. package/esm/client/expect/to_match_image_snapshot.types.d.ts +7 -0
  17. package/esm/client/expect/to_match_image_snapshot.types.d.ts.map +1 -0
  18. package/esm/client/expect/to_match_image_snapshot.types.js +1 -0
  19. package/esm/client/page/extend.d.ts +6 -0
  20. package/esm/client/page/extend.d.ts.map +1 -0
  21. package/esm/client/page/extend.js +3 -0
  22. package/esm/client/page/has_image_snapshot.d.ts +10 -0
  23. package/esm/client/page/has_image_snapshot.d.ts.map +1 -0
  24. package/esm/client/page/has_image_snapshot.js +23 -0
  25. package/esm/client/selector.d.ts +9 -0
  26. package/esm/client/selector.d.ts.map +1 -0
  27. package/esm/client/selector.js +104 -0
  28. package/esm/client/should_take_snapshot.d.ts +10 -0
  29. package/esm/client/should_take_snapshot.d.ts.map +1 -0
  30. package/esm/client/should_take_snapshot.js +13 -0
  31. package/esm/client/snapshot_options.d.ts +34 -0
  32. package/esm/client/snapshot_options.d.ts.map +1 -0
  33. package/esm/client/snapshot_options.internal.d.ts +3 -0
  34. package/esm/client/snapshot_options.internal.d.ts.map +1 -0
  35. package/esm/client/snapshot_options.internal.js +20 -0
  36. package/esm/client/snapshot_options.js +16 -0
  37. package/esm/client/task_id.d.ts +7 -0
  38. package/esm/client/task_id.d.ts.map +1 -0
  39. package/esm/client/task_id.js +10 -0
  40. package/esm/client.d.ts +8 -0
  41. package/esm/client.d.ts.map +1 -0
  42. package/esm/client.js +5 -0
  43. package/esm/commands.d.ts +5 -0
  44. package/esm/commands.d.ts.map +1 -0
  45. package/esm/commands.js +4 -0
  46. package/esm/config/types.d.ts +35 -0
  47. package/esm/config/types.d.ts.map +1 -0
  48. package/esm/config/types.js +1 -0
  49. package/esm/config/vis.d.ts +25 -0
  50. package/esm/config/vis.d.ts.map +1 -0
  51. package/esm/config/vis.js +27 -0
  52. package/esm/config.d.ts +4 -0
  53. package/esm/config.d.ts.map +1 -0
  54. package/esm/config.js +2 -0
  55. package/esm/index.d.ts +2 -0
  56. package/esm/index.d.ts.map +1 -0
  57. package/esm/index.js +2 -0
  58. package/esm/presets/auto.d.ts +2 -0
  59. package/esm/presets/auto.d.ts.map +1 -0
  60. package/esm/presets/auto.js +3 -0
  61. package/esm/presets/manual.d.ts +2 -0
  62. package/esm/presets/manual.d.ts.map +1 -0
  63. package/esm/presets/manual.js +3 -0
  64. package/esm/server/browser_provider/browser_api.d.ts +3 -0
  65. package/esm/server/browser_provider/browser_api.d.ts.map +1 -0
  66. package/esm/server/browser_provider/browser_api.js +11 -0
  67. package/esm/server/browser_provider/playwright.d.ts +4 -0
  68. package/esm/server/browser_provider/playwright.d.ts.map +1 -0
  69. package/esm/server/browser_provider/playwright.js +13 -0
  70. package/esm/server/browser_provider/types.d.ts +6 -0
  71. package/esm/server/browser_provider/types.d.ts.map +1 -0
  72. package/esm/server/browser_provider/types.js +1 -0
  73. package/esm/server/browser_provider/webdriverio.d.ts +4 -0
  74. package/esm/server/browser_provider/webdriverio.d.ts.map +1 -0
  75. package/esm/server/browser_provider/webdriverio.js +10 -0
  76. package/esm/server/commands/extend.d.ts +15 -0
  77. package/esm/server/commands/extend.d.ts.map +1 -0
  78. package/esm/server/commands/extend.js +10 -0
  79. package/esm/server/commands/has_image_snapshot.d.ts +6 -0
  80. package/esm/server/commands/has_image_snapshot.d.ts.map +1 -0
  81. package/esm/server/commands/has_image_snapshot.js +7 -0
  82. package/esm/server/commands/image_snapshot_next_index.d.ts +9 -0
  83. package/esm/server/commands/image_snapshot_next_index.d.ts.map +1 -0
  84. package/esm/server/commands/image_snapshot_next_index.js +7 -0
  85. package/esm/server/commands/is_ci.d.ts +2 -0
  86. package/esm/server/commands/is_ci.d.ts.map +1 -0
  87. package/esm/server/commands/is_ci.js +6 -0
  88. package/esm/server/commands/match_image_snapshot.d.ts +17 -0
  89. package/esm/server/commands/match_image_snapshot.d.ts.map +1 -0
  90. package/esm/server/commands/match_image_snapshot.js +88 -0
  91. package/esm/server/commands/setup_vis_suite.d.ts +13 -0
  92. package/esm/server/commands/setup_vis_suite.d.ts.map +1 -0
  93. package/esm/server/commands/setup_vis_suite.js +4 -0
  94. package/esm/server/compare_image.d.ts +8 -0
  95. package/esm/server/compare_image.d.ts.map +1 -0
  96. package/esm/server/compare_image.js +16 -0
  97. package/esm/server/file.d.ts +6 -0
  98. package/esm/server/file.d.ts.map +1 -0
  99. package/esm/server/file.js +14 -0
  100. package/esm/server/snapshot_path.d.ts +4 -0
  101. package/esm/server/snapshot_path.d.ts.map +1 -0
  102. package/esm/server/snapshot_path.js +9 -0
  103. package/esm/server/vis_context.ctx.d.ts +29 -0
  104. package/esm/server/vis_context.ctx.d.ts.map +1 -0
  105. package/esm/server/vis_context.ctx.js +11 -0
  106. package/esm/server/vis_context.d.ts +33 -0
  107. package/esm/server/vis_context.d.ts.map +1 -0
  108. package/esm/server/vis_context.js +2 -0
  109. package/esm/server/vis_context.logic.d.ts +63 -0
  110. package/esm/server/vis_context.logic.d.ts.map +1 -0
  111. package/esm/server/vis_context.logic.js +116 -0
  112. package/esm/server/vis_context.types.d.ts +20 -0
  113. package/esm/server/vis_context.types.d.ts.map +1 -0
  114. package/esm/server/vis_context.types.js +1 -0
  115. package/esm/setup/create_vis.d.ts +39 -0
  116. package/esm/setup/create_vis.d.ts.map +1 -0
  117. package/esm/setup/create_vis.js +96 -0
  118. package/esm/setup/vis.d.ts +18 -0
  119. package/esm/setup/vis.d.ts.map +1 -0
  120. package/esm/setup/vis.js +6 -0
  121. package/esm/setup.d.ts +5 -0
  122. package/esm/setup.d.ts.map +1 -0
  123. package/esm/setup.js +7 -0
  124. package/esm/shared/base64.d.ts +2 -0
  125. package/esm/shared/base64.d.ts.map +1 -0
  126. package/esm/shared/base64.js +3 -0
  127. package/esm/shared/constants.d.ts +5 -0
  128. package/esm/shared/constants.d.ts.map +1 -0
  129. package/esm/shared/constants.js +4 -0
  130. package/esm/shared/convert_threshold_unit.d.ts +6 -0
  131. package/esm/shared/convert_threshold_unit.d.ts.map +1 -0
  132. package/esm/shared/convert_threshold_unit.js +10 -0
  133. package/esm/shared/get_max_size.d.ts +11 -0
  134. package/esm/shared/get_max_size.d.ts.map +1 -0
  135. package/esm/shared/get_max_size.js +5 -0
  136. package/esm/shared/is_same_size.d.ts +8 -0
  137. package/esm/shared/is_same_size.d.ts.map +1 -0
  138. package/esm/shared/is_same_size.js +3 -0
  139. package/esm/shared/trim_common_folder.d.ts +6 -0
  140. package/esm/shared/trim_common_folder.d.ts.map +1 -0
  141. package/esm/shared/trim_common_folder.js +10 -0
  142. package/esm/shared/types.d.ts +37 -0
  143. package/esm/shared/types.d.ts.map +1 -0
  144. package/esm/shared/types.js +1 -0
  145. package/esm/testing/constants.d.ts +9 -0
  146. package/esm/testing/constants.d.ts.map +1 -0
  147. package/esm/testing/constants.js +1933 -0
  148. package/esm/testing.d.ts +2 -0
  149. package/esm/testing.d.ts.map +1 -0
  150. package/esm/testing.js +1 -0
  151. package/package.json +115 -0
  152. package/readme.md +264 -0
  153. package/src/client/ctx.ts +8 -0
  154. package/src/client/expect/expectation_result.ts +7 -0
  155. package/src/client/expect/extend.ts +12 -0
  156. package/src/client/expect/to_match_image_snapshot.logic.ts +11 -0
  157. package/src/client/expect/to_match_image_snapshot.ts +43 -0
  158. package/src/client/expect/to_match_image_snapshot.types.ts +14 -0
  159. package/src/client/page/extend.ts +8 -0
  160. package/src/client/page/has_image_snapshot.ts +33 -0
  161. package/src/client/selector.ts +118 -0
  162. package/src/client/should_take_snapshot.ts +15 -0
  163. package/src/client/snapshot_options.internal.ts +22 -0
  164. package/src/client/snapshot_options.ts +53 -0
  165. package/src/client/task_id.ts +16 -0
  166. package/src/client.ts +7 -0
  167. package/src/commands.ts +4 -0
  168. package/src/config/readme.md +4 -0
  169. package/src/config/types.ts +35 -0
  170. package/src/config/vis.ts +30 -0
  171. package/src/config.ts +3 -0
  172. package/src/index.ts +2 -0
  173. package/src/presets/auto.ts +4 -0
  174. package/src/presets/manual.ts +4 -0
  175. package/src/server/browser_provider/browser_api.ts +13 -0
  176. package/src/server/browser_provider/playwright.ts +16 -0
  177. package/src/server/browser_provider/types.ts +11 -0
  178. package/src/server/browser_provider/webdriverio.ts +13 -0
  179. package/src/server/commands/extend.ts +19 -0
  180. package/src/server/commands/has_image_snapshot.ts +18 -0
  181. package/src/server/commands/image_snapshot_next_index.ts +17 -0
  182. package/src/server/commands/is_ci.ts +7 -0
  183. package/src/server/commands/match_image_snapshot.ts +139 -0
  184. package/src/server/commands/setup_vis_suite.ts +17 -0
  185. package/src/server/compare_image.ts +34 -0
  186. package/src/server/file.ts +15 -0
  187. package/src/server/readme.md +5 -0
  188. package/src/server/snapshot_path.ts +12 -0
  189. package/src/server/vis_context.ctx.ts +12 -0
  190. package/src/server/vis_context.logic.ts +141 -0
  191. package/src/server/vis_context.ts +3 -0
  192. package/src/server/vis_context.types.ts +25 -0
  193. package/src/setup/create_vis.ts +98 -0
  194. package/src/setup/vis.ts +7 -0
  195. package/src/setup.ts +9 -0
  196. package/src/shared/base64.ts +3 -0
  197. package/src/shared/constants.ts +4 -0
  198. package/src/shared/convert_threshold_unit.ts +13 -0
  199. package/src/shared/get_max_size.ts +5 -0
  200. package/src/shared/is_same_size.ts +3 -0
  201. package/src/shared/trim_common_folder.ts +10 -0
  202. package/src/shared/types.ts +39 -0
  203. package/src/testing/constants.ts +1936 -0
  204. package/src/testing.ts +1 -0
@@ -0,0 +1,116 @@
1
+ import { join, relative } from 'pathe';
2
+ import { DIFF_DIR, RESULT_DIR } from "../shared/constants.js";
3
+ import { file } from "./file.js";
4
+ import { getSnapshotSubpath, resolveSnapshotRootDir } from "./snapshot_path.js";
5
+ import { ctx } from "./vis_context.ctx.js";
6
+ export function createVisContext() {
7
+ let visOptions = {};
8
+ let state;
9
+ let globalStateReady;
10
+ const context = {
11
+ setOptions(options = {}) {
12
+ visOptions = options;
13
+ },
14
+ __test__getOptions() {
15
+ return visOptions;
16
+ },
17
+ __test__reset() {
18
+ visOptions = undefined;
19
+ },
20
+ __test__getState() {
21
+ return state;
22
+ },
23
+ /**
24
+ * Setup suite is called on each test file's beforeAll hook.
25
+ * Test files include vitest test files and storybook story files.
26
+ * It needs to make sure there is no race condition between the test files.
27
+ */
28
+ async setupSuite(context) {
29
+ if (!globalStateReady) {
30
+ globalStateReady = setupState(context, visOptions);
31
+ state = await globalStateReady;
32
+ }
33
+ else {
34
+ await globalStateReady;
35
+ }
36
+ const { suiteId, suite } = createSuite(state, context.testPath, visOptions);
37
+ state.suites[suiteId] = suite;
38
+ await Promise.allSettled([ctx.rimraf(suite.diffDir), ctx.rimraf(suite.resultDir)]);
39
+ },
40
+ getSnapshotInfo(testPath, name, options) {
41
+ const info = context.getSuiteInfo(testPath, name);
42
+ const snapshotFilename = context.getSnapshotFilename(info, options?.snapshotFileId);
43
+ const { baselineDir, resultDir, diffDir, task } = info;
44
+ task.count = task.count + 1;
45
+ const baselinePath = join(baselineDir, snapshotFilename);
46
+ const resultPath = join(resultDir, snapshotFilename);
47
+ const diffPath = join(diffDir, snapshotFilename);
48
+ return {
49
+ baselinePath,
50
+ resultPath,
51
+ diffPath,
52
+ };
53
+ },
54
+ getTaskCount(testPath, taskId) {
55
+ return context.getSuiteInfo(testPath, taskId).task.count;
56
+ },
57
+ hasImageSnapshot(testPath, taskId, snapshotFileId) {
58
+ const info = context.getSuiteInfo(testPath, taskId);
59
+ return file.existFile(join(info.baselineDir, context.getSnapshotFilename(info, snapshotFileId)));
60
+ },
61
+ getSnapshotFilename(info, snapshotFileId) {
62
+ if (snapshotFileId)
63
+ return `${snapshotFileId}.png`;
64
+ const customizeSnapshotId = visOptions.customizeSnapshotId ?? ((id, index) => `${id}-${index}`);
65
+ return `${customizeSnapshotId(info.taskId, info.task.count)}.png`;
66
+ },
67
+ getSuiteInfo(testPath, taskId) {
68
+ const suiteId = getSuiteId(state, testPath, visOptions);
69
+ const suite = state.suites[suiteId];
70
+ const task = (suite.tasks[taskId] = suite.tasks[taskId] ?? { count: 1 });
71
+ return {
72
+ suiteId,
73
+ taskId,
74
+ baselineDir: suite.baselineDir,
75
+ resultDir: suite.resultDir,
76
+ diffDir: suite.diffDir,
77
+ task,
78
+ };
79
+ },
80
+ };
81
+ return context;
82
+ }
83
+ async function setupState(suite, visOptions) {
84
+ const snapshotRootDir = resolveSnapshotRootDir(visOptions);
85
+ const projectPath = suite.project.config.root;
86
+ const platform = ctx.getSnapshotPlatform();
87
+ const state = {
88
+ projectPath,
89
+ platform,
90
+ testTimeout: suite.project.config.testTimeout,
91
+ hookTimeout: suite.project.config.hookTimeout,
92
+ snapshotRootDir,
93
+ snapshotBaselineDir: join(snapshotRootDir, platform),
94
+ snapshotResultDir: join(snapshotRootDir, RESULT_DIR),
95
+ snapshotDiffDir: join(snapshotRootDir, DIFF_DIR),
96
+ snapshotRootPath: join(projectPath, snapshotRootDir),
97
+ suites: {},
98
+ };
99
+ await Promise.allSettled([ctx.rimraf(join(state.snapshotDiffDir)), ctx.rimraf(join(state.snapshotResultDir))]);
100
+ return state;
101
+ }
102
+ export function getSuiteId(state, testPath, options) {
103
+ return getSnapshotSubpath(relative(state.projectPath, testPath), options);
104
+ }
105
+ export function createSuite(state, testPath, options) {
106
+ const suiteId = getSuiteId(state, testPath, options);
107
+ return {
108
+ suiteId,
109
+ suite: {
110
+ baselineDir: join(state.snapshotBaselineDir, suiteId),
111
+ resultDir: join(state.snapshotResultDir, suiteId),
112
+ diffDir: join(state.snapshotDiffDir, suiteId),
113
+ tasks: {},
114
+ },
115
+ };
116
+ }
@@ -0,0 +1,20 @@
1
+ export type VisState = {
2
+ projectPath: string;
3
+ platform: string;
4
+ testTimeout: number;
5
+ hookTimeout: number;
6
+ snapshotRootDir: string;
7
+ snapshotBaselineDir: string;
8
+ snapshotResultDir: string;
9
+ snapshotDiffDir: string;
10
+ snapshotRootPath: string;
11
+ suites: Record<string, {
12
+ baselineDir: string;
13
+ resultDir: string;
14
+ diffDir: string;
15
+ tasks: Record<string, {
16
+ count: number;
17
+ }>;
18
+ }>;
19
+ };
20
+ //# sourceMappingURL=vis_context.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vis_context.types.d.ts","sourceRoot":"","sources":["../../src/server/vis_context.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,MAAM,CAAA;IACvB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,iBAAiB,EAAE,MAAM,CAAA;IACzB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,MAAM,EAAE,MAAM,CACb,MAAM,EACN;QACC,WAAW,EAAE,MAAM,CAAA;QACnB,SAAS,EAAE,MAAM,CAAA;QACjB,OAAO,EAAE,MAAM,CAAA;QACf,KAAK,EAAE,MAAM,CACZ,MAAM,EACN;YACC,KAAK,EAAE,MAAM,CAAA;SACb,CACD,CAAA;KACD,CACD,CAAA;CACD,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,39 @@
1
+ import type { SetupVisSuiteCommand } from '../server/commands/setup_vis_suite.ts';
2
+ export declare function createVis(commands: SetupVisSuiteCommand): {
3
+ presets: {
4
+ /**
5
+ * Enable manual visual testing.
6
+ */
7
+ manual(): void;
8
+ /**
9
+ * Enable automatic visual testing.
10
+ *
11
+ * This will take a snapshot after each test.
12
+ */
13
+ auto(): void;
14
+ /**
15
+ * Enable automatic visual testing with multiple themes.
16
+ *
17
+ * This will take a snapshot after each test for each theme.
18
+ *
19
+ * @param themes A record of theme names and their setup functions.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * vis().presets.theme({
24
+ * light() { document.body.classList.add('light') },
25
+ * dark() { document.body.classList.add('dark') },
26
+ * })
27
+ * ```
28
+ */
29
+ theme(themes: Record<string, () => void | Promise<void>>): void;
30
+ };
31
+ beforeAll: {
32
+ setup(): Promise<void>;
33
+ };
34
+ afterEach: {
35
+ matchImageSnapshot(): Promise<void>;
36
+ matchPerTheme(themes: Record<string, () => Promise<void> | void>): () => Promise<void>;
37
+ };
38
+ };
39
+ //# sourceMappingURL=create_vis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create_vis.d.ts","sourceRoot":"","sources":["../../src/setup/create_vis.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAEjF,wBAAgB,SAAS,CAAC,QAAQ,EAAE,oBAAoB;;QAMrD;;WAEG;;QAIH;;;;WAIG;;QAKH;;;;;;;;;;;;;;WAcG;sBACW,MAAM,CAAC,MAAM,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;;;;;;;8BAgBlC,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;;EAqClE"}
@@ -0,0 +1,96 @@
1
+ import dedent from 'dedent';
2
+ import { afterEach, beforeAll, expect } from 'vitest';
3
+ import { toTaskId } from "../client.js";
4
+ import { ctx } from "../client/ctx.js";
5
+ import { shouldTakeSnapshot } from "../client/should_take_snapshot.js";
6
+ import { getAutoSnapshotOptions } from '../client/snapshot_options.internal.js';
7
+ export function createVis(commands) {
8
+ /**
9
+ * Visual test configuration on the client side.
10
+ */
11
+ const vis = {
12
+ presets: {
13
+ /**
14
+ * Enable manual visual testing.
15
+ */
16
+ manual() {
17
+ beforeAll(vis.beforeAll.setup);
18
+ },
19
+ /**
20
+ * Enable automatic visual testing.
21
+ *
22
+ * This will take a snapshot after each test.
23
+ */
24
+ auto() {
25
+ beforeAll(vis.beforeAll.setup);
26
+ afterEach(vis.afterEach.matchImageSnapshot);
27
+ },
28
+ /**
29
+ * Enable automatic visual testing with multiple themes.
30
+ *
31
+ * This will take a snapshot after each test for each theme.
32
+ *
33
+ * @param themes A record of theme names and their setup functions.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * vis().presets.theme({
38
+ * light() { document.body.classList.add('light') },
39
+ * dark() { document.body.classList.add('dark') },
40
+ * })
41
+ * ```
42
+ */
43
+ theme(themes) {
44
+ beforeAll(vis.beforeAll.setup);
45
+ afterEach(vis.afterEach.matchPerTheme(themes));
46
+ },
47
+ },
48
+ beforeAll: {
49
+ async setup() {
50
+ await commands.setupVisSuite();
51
+ },
52
+ },
53
+ afterEach: {
54
+ async matchImageSnapshot() {
55
+ const meta = getAutoSnapshotOptions(ctx.getCurrentTest());
56
+ if (!shouldTakeSnapshot(meta))
57
+ return;
58
+ await expect(document.body).toMatchImageSnapshot(meta);
59
+ },
60
+ matchPerTheme(themes) {
61
+ return async function matchImageSnapshot() {
62
+ const test = ctx.getCurrentTest();
63
+ const meta = getAutoSnapshotOptions(test);
64
+ if (!shouldTakeSnapshot(meta))
65
+ return;
66
+ const errors = [];
67
+ for (const themeId in themes) {
68
+ try {
69
+ await themes[themeId]();
70
+ await expect(document.body).toMatchImageSnapshot({
71
+ ...meta,
72
+ customizeSnapshotId: (id) => `${id}-${themeId}`,
73
+ });
74
+ }
75
+ catch (error) {
76
+ errors.push([themeId, error]);
77
+ }
78
+ }
79
+ if (errors.length > 0) {
80
+ if (errors.length === 1)
81
+ throw errors[0][1];
82
+ const taskId = toTaskId(test);
83
+ throw new AggregateError(errors, dedent `Snapshot \`${taskId}\` mismatched
84
+
85
+ ${errors
86
+ .map(([themeId, error]) => {
87
+ return `Theme \`${themeId}\` failed: ${error.message}`;
88
+ })
89
+ .join('\n')}`);
90
+ }
91
+ };
92
+ },
93
+ },
94
+ };
95
+ return vis;
96
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Visual test configuration on the client side.
3
+ */
4
+ export declare const vis: {
5
+ presets: {
6
+ manual(): void;
7
+ auto(): void;
8
+ theme(themes: Record<string, () => void | Promise<void>>): void;
9
+ };
10
+ beforeAll: {
11
+ setup(): Promise<void>;
12
+ };
13
+ afterEach: {
14
+ matchImageSnapshot(): Promise<void>;
15
+ matchPerTheme(themes: Record<string, () => Promise<void> | void>): () => Promise<void>;
16
+ };
17
+ };
18
+ //# sourceMappingURL=vis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vis.d.ts","sourceRoot":"","sources":["../../src/setup/vis.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;;;CAAsB,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { commands } from '@vitest/browser/context';
2
+ import { createVis } from "./create_vis.js";
3
+ /**
4
+ * Visual test configuration on the client side.
5
+ */
6
+ export const vis = createVis(commands);
package/esm/setup.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import './client/expect/extend.ts';
2
+ import './client/page/extend.ts';
3
+ export * from './setup/vis.ts';
4
+ export * from './setup/create_vis.ts';
5
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AACA,OAAO,2BAA2B,CAAA;AAClC,OAAO,yBAAyB,CAAA;AAEhC,cAAc,gBAAgB,CAAA;AAI9B,cAAc,uBAAuB,CAAA"}
package/esm/setup.js ADDED
@@ -0,0 +1,7 @@
1
+ // `vitest-plugin-vis/setup` provides code needed in `vitest.setup.ts`.
2
+ import "./client/expect/extend.js";
3
+ import "./client/page/extend.js";
4
+ export * from "./setup/vis.js";
5
+ // This is exported for main/app boundary separation
6
+ // They can co-exist in the same export file thanks to ESM.
7
+ export * from "./setup/create_vis.js";
@@ -0,0 +1,2 @@
1
+ export declare function isBase64String(value: unknown): value is string;
2
+ //# sourceMappingURL=base64.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src/shared/base64.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE9D"}
@@ -0,0 +1,3 @@
1
+ export function isBase64String(value) {
2
+ return typeof value === 'string' && /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/.test(value);
3
+ }
@@ -0,0 +1,5 @@
1
+ export declare const NAME = "vis";
2
+ export declare const SNAPSHOT_ROOT_DIR = "__vis__";
3
+ export declare const RESULT_DIR = "__results__";
4
+ export declare const DIFF_DIR = "__diffs__";
5
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/shared/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,QAAQ,CAAA;AACzB,eAAO,MAAM,iBAAiB,YAAY,CAAA;AAC1C,eAAO,MAAM,UAAU,gBAAgB,CAAA;AACvC,eAAO,MAAM,QAAQ,cAAc,CAAA"}
@@ -0,0 +1,4 @@
1
+ export const NAME = 'vis';
2
+ export const SNAPSHOT_ROOT_DIR = '__vis__';
3
+ export const RESULT_DIR = '__results__';
4
+ export const DIFF_DIR = '__diffs__';
@@ -0,0 +1,6 @@
1
+ export declare function convertThresholdUnit({ failureThresholdType, width, height }: {
2
+ failureThresholdType: 'pixel' | 'percent';
3
+ width: number;
4
+ height: number;
5
+ }, pixelDiff: number): number;
6
+ //# sourceMappingURL=convert_threshold_unit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert_threshold_unit.d.ts","sourceRoot":"","sources":["../../src/shared/convert_threshold_unit.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CACnC,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IAAE,oBAAoB,EAAE,OAAO,GAAG,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EACrH,SAAS,EAAE,MAAM,GACf,MAAM,CASR"}
@@ -0,0 +1,10 @@
1
+ export function convertThresholdUnit({ failureThresholdType, width, height }, pixelDiff) {
2
+ switch (failureThresholdType) {
3
+ case 'pixel':
4
+ return pixelDiff;
5
+ case 'percent':
6
+ return (pixelDiff / (width * height)) * 100;
7
+ default:
8
+ throw new Error(`Invalid failureThresholdType: ${failureThresholdType}`);
9
+ }
10
+ }
@@ -0,0 +1,11 @@
1
+ export declare function getMaxSize(image1: {
2
+ width: number;
3
+ height: number;
4
+ }, image2: {
5
+ width: number;
6
+ height: number;
7
+ }): {
8
+ width: number;
9
+ height: number;
10
+ };
11
+ //# sourceMappingURL=get_max_size.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_max_size.d.ts","sourceRoot":"","sources":["../../src/shared/get_max_size.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;;;EAI9G"}
@@ -0,0 +1,5 @@
1
+ export function getMaxSize(image1, image2) {
2
+ const width = Math.max(image1.width, image2.width);
3
+ const height = Math.max(image1.height, image2.height);
4
+ return { width, height };
5
+ }
@@ -0,0 +1,8 @@
1
+ export declare function isSameSize(image1: {
2
+ width: number;
3
+ height: number;
4
+ }, image2: {
5
+ width: number;
6
+ height: number;
7
+ }): boolean;
8
+ //# sourceMappingURL=is_same_size.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is_same_size.d.ts","sourceRoot":"","sources":["../../src/shared/is_same_size.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,WAE9G"}
@@ -0,0 +1,3 @@
1
+ export function isSameSize(image1, image2) {
2
+ return image1.width === image2.width && image1.height === image2.height;
3
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Trim off common folder such as `src` or `tests` from the test file path.
3
+ * This is used to generate the default snapshot sub-path.
4
+ */
5
+ export declare function trimCommonFolder(suiteName: string): string;
6
+ //# sourceMappingURL=trim_common_folder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trim_common_folder.d.ts","sourceRoot":"","sources":["../../src/shared/trim_common_folder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,UAKjD"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Trim off common folder such as `src` or `tests` from the test file path.
3
+ * This is used to generate the default snapshot sub-path.
4
+ */
5
+ export function trimCommonFolder(suiteName) {
6
+ const suiteDir = suiteName.split('/', 1)[0];
7
+ if (['tests', 'test', 'src', 'source', 'js', 'ts', 'lib'].includes(suiteDir))
8
+ return suiteName.slice(suiteDir.length + 1);
9
+ return suiteName;
10
+ }
@@ -0,0 +1,37 @@
1
+ import type { PixelmatchOptions } from 'pixelmatch';
2
+ export interface ImageSnapshotTimeoutOptions {
3
+ /**
4
+ * Timeout for taking the snapshot.
5
+ *
6
+ * Default: 5000 ms locally, 30000 ms on CI.
7
+ */
8
+ timeout?: number | undefined;
9
+ }
10
+ export interface ImageSnapshotIdOptions {
11
+ /**
12
+ * Customize the snapshot id. This is used as the filename of the snapshot: `${snapshotId}.png`
13
+ *
14
+ * @param id The id of the snapshot.
15
+ * @param index The index of the snapshot.
16
+ */
17
+ customizeSnapshotId?: (id: string, index: number) => string;
18
+ }
19
+ export interface ImageSnapshotCompareOptions {
20
+ /**
21
+ * Custom options passed to 'pixelmatch'
22
+ */
23
+ diffOptions?: PixelmatchOptions | undefined;
24
+ /**
25
+ * Failure threshold should measure in `pixel` or `percent`.
26
+ *
27
+ * Default is `pixel`.
28
+ */
29
+ failureThresholdType?: 'pixel' | 'percent' | undefined;
30
+ /**
31
+ * Failure tolerance threshold.
32
+ *
33
+ * Default is `0`.
34
+ */
35
+ failureThreshold?: number | undefined;
36
+ }
37
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD,MAAM,WAAW,2BAA2B;IAC3C;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACtC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;CAC3D;AAED,MAAM,WAAW,2BAA2B;IAC3C;;OAEG;IACH,WAAW,CAAC,EAAE,iBAAiB,GAAG,SAAS,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u4dLsSBzDVyIwlCISWCta7G9DojCmDDlOfmT4wXQyo0Eg7WdjLxMbqGP+glSLP6mpzo7Pq7Pjc/Fm8Bw3UE0ns2o6mfmU5/XZ6WRG7yk14u3iOcuMSolK+wqgL9c2llugzJ0ldWOxMXpOLtfMMAzDMAzDMAzDMAzDMAzDMAzDMAyzI/wP4r+0NOqCJLoAAAAASUVORK5CYII=";
3
+ export declare const UNI_IMAGE_DATA: {
4
+ width: number;
5
+ height: number;
6
+ colorSpace: PredefinedColorSpace;
7
+ data: Uint8ClampedArray<ArrayBuffer>;
8
+ };
9
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/testing/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,qqGACwoG,CAAA;AAEnqG,eAAO,MAAM,WAAW,2rGAA4C,CAAA;AAEpE,eAAO,MAAM,cAAc;;;gBAGJ,oBAAoB;;CAu4D1C,CAAA"}