@lullabot/playwright-testing 1.0.0 → 1.1.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 (68) hide show
  1. package/bin/github-a11y-summary +2 -2
  2. package/bin/github-failure-summary +4 -4
  3. package/lib/accessibility-baseline-file.d.ts +6 -6
  4. package/lib/accessibility-baseline-file.js +29 -23
  5. package/lib/accessibility-baseline.js +5 -3
  6. package/lib/accessible-screenshot.d.ts +4 -4
  7. package/lib/accessible-screenshot.js +110 -88
  8. package/lib/focus.js +4 -1
  9. package/lib/frames.js +4 -4
  10. package/lib/github/a11y-summary.js +74 -79
  11. package/lib/github/attachments.d.ts +1 -1
  12. package/lib/github/attachments.js +36 -34
  13. package/lib/github/failure-summary.d.ts +4 -4
  14. package/lib/github/failure-summary.js +140 -108
  15. package/lib/github/index.d.ts +6 -6
  16. package/lib/github/report-paths.js +17 -9
  17. package/lib/hover.js +17 -17
  18. package/lib/images.js +15 -12
  19. package/lib/index.d.ts +13 -13
  20. package/lib/interaction-states.d.ts +2 -2
  21. package/lib/interaction-states.js +7 -7
  22. package/lib/mock/index.d.ts +1 -1
  23. package/lib/mock/youtube.d.ts +1 -1
  24. package/lib/mock/youtube.js +1 -1
  25. package/lib/pseudo-state.d.ts +2 -2
  26. package/lib/pseudo-state.js +15 -7
  27. package/lib/videos.js +21 -10
  28. package/lib/visualdiff.d.ts +4 -4
  29. package/lib/visualdiff.js +35 -27
  30. package/package.json +3 -3
  31. package/src/accessibility-baseline-file.test.ts +190 -154
  32. package/src/accessibility-baseline-file.ts +107 -83
  33. package/src/accessibility-baseline.test.ts +869 -433
  34. package/src/accessibility-baseline.ts +41 -21
  35. package/src/accessible-screenshot.test.ts +551 -423
  36. package/src/accessible-screenshot.ts +358 -251
  37. package/src/focus.test.ts +23 -23
  38. package/src/focus.ts +7 -2
  39. package/src/fonts.test.ts +13 -13
  40. package/src/fonts.ts +1 -1
  41. package/src/frames.test.ts +10 -8
  42. package/src/frames.ts +5 -5
  43. package/src/github/a11y-summary.test.ts +436 -332
  44. package/src/github/a11y-summary.ts +189 -179
  45. package/src/github/attachments.test.ts +228 -167
  46. package/src/github/attachments.ts +144 -121
  47. package/src/github/failure-summary.test.ts +660 -445
  48. package/src/github/failure-summary.ts +376 -274
  49. package/src/github/index.test.ts +14 -14
  50. package/src/github/index.ts +6 -6
  51. package/src/github/report-paths.test.ts +211 -156
  52. package/src/github/report-paths.ts +75 -61
  53. package/src/hover.test.ts +50 -46
  54. package/src/hover.ts +18 -18
  55. package/src/images.test.ts +251 -206
  56. package/src/images.ts +52 -43
  57. package/src/index.ts +13 -13
  58. package/src/interaction-states.test.ts +72 -42
  59. package/src/interaction-states.ts +43 -29
  60. package/src/mock/index.ts +1 -1
  61. package/src/mock/youtube.test.ts +26 -26
  62. package/src/mock/youtube.ts +4 -6
  63. package/src/pseudo-state.test.ts +58 -51
  64. package/src/pseudo-state.ts +32 -27
  65. package/src/videos.test.ts +559 -399
  66. package/src/videos.ts +68 -44
  67. package/src/visualdiff.test.ts +416 -315
  68. package/src/visualdiff.ts +140 -99
@@ -1,4 +1,4 @@
1
- import { describe, expect, it } from 'vitest'
1
+ import { describe, expect, it } from "vitest";
2
2
  import {
3
3
  AttachmentUploader,
4
4
  createPathResolver,
@@ -8,17 +8,17 @@ import {
8
8
  generateFailureSummary,
9
9
  parseA11yResults,
10
10
  parseFailures,
11
- } from './index'
11
+ } from "./index";
12
12
 
13
- describe('GitHub package entry point', () => {
14
- it('exports the reporting, attachment, and path-remapping APIs', () => {
15
- expect(parseA11yResults).toBeTypeOf('function')
16
- expect(generateA11ySummary).toBeTypeOf('function')
17
- expect(generateA11yAnnotations).toBeTypeOf('function')
18
- expect(parseFailures).toBeTypeOf('function')
19
- expect(generateFailureSummary).toBeTypeOf('function')
20
- expect(generateFailureComment).toBeTypeOf('function')
21
- expect(AttachmentUploader).toBeTypeOf('function')
22
- expect(createPathResolver).toBeTypeOf('function')
23
- })
24
- })
13
+ describe("GitHub package entry point", () => {
14
+ it("exports the reporting, attachment, and path-remapping APIs", () => {
15
+ expect(parseA11yResults).toBeTypeOf("function");
16
+ expect(generateA11ySummary).toBeTypeOf("function");
17
+ expect(generateA11yAnnotations).toBeTypeOf("function");
18
+ expect(parseFailures).toBeTypeOf("function");
19
+ expect(generateFailureSummary).toBeTypeOf("function");
20
+ expect(generateFailureComment).toBeTypeOf("function");
21
+ expect(AttachmentUploader).toBeTypeOf("function");
22
+ expect(createPathResolver).toBeTypeOf("function");
23
+ });
24
+ });
@@ -3,10 +3,10 @@ export {
3
3
  generateSummary as generateA11ySummary,
4
4
  main as runA11ySummary,
5
5
  parseA11yResults,
6
- } from './a11y-summary'
7
- export type { A11yReport, A11yTestResult } from './a11y-summary'
6
+ } from "./a11y-summary";
7
+ export type { A11yReport, A11yTestResult } from "./a11y-summary";
8
8
 
9
- export * from './attachments'
9
+ export * from "./attachments";
10
10
 
11
11
  export {
12
12
  FAILURE_MARKER_PREFIX,
@@ -19,7 +19,7 @@ export {
19
19
  resolveImagePaths,
20
20
  uploaderFromEnvironment,
21
21
  uploadImages,
22
- } from './failure-summary'
22
+ } from "./failure-summary";
23
23
  export type {
24
24
  FailedTest,
25
25
  FailureImage,
@@ -30,6 +30,6 @@ export type {
30
30
  IncludeMode,
31
31
  PathResolutionSummary,
32
32
  SummaryOptions,
33
- } from './failure-summary'
33
+ } from "./failure-summary";
34
34
 
35
- export * from './report-paths'
35
+ export * from "./report-paths";
@@ -1,222 +1,277 @@
1
- import { describe, it, expect, beforeEach, afterEach } from 'vitest'
2
- import * as fs from 'fs'
3
- import * as os from 'os'
4
- import * as path from 'path'
5
- import { createPathResolver, parsePathPrefix } from './report-paths'
1
+ import { describe, it, expect, beforeEach, afterEach } from "vitest";
2
+ import * as fs from "fs";
3
+ import * as os from "os";
4
+ import * as path from "path";
5
+ import { createPathResolver, parsePathPrefix } from "./report-paths";
6
6
 
7
- let tmpDir: string
7
+ let tmpDir: string;
8
8
 
9
9
  beforeEach(() => {
10
- tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'report-paths-test-'))
11
- })
10
+ tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "report-paths-test-"));
11
+ });
12
12
 
13
13
  afterEach(() => {
14
- fs.rmSync(tmpDir, { recursive: true, force: true })
15
- })
14
+ fs.rmSync(tmpDir, { recursive: true, force: true });
15
+ });
16
16
 
17
17
  /** Create a file, and every directory above it, under the temporary directory. */
18
18
  function touch(relativePath: string): string {
19
- const filePath = path.join(tmpDir, relativePath)
20
- fs.mkdirSync(path.dirname(filePath), { recursive: true })
21
- fs.writeFileSync(filePath, 'png')
22
- return filePath
19
+ const filePath = path.join(tmpDir, relativePath);
20
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
21
+ fs.writeFileSync(filePath, "png");
22
+ return filePath;
23
23
  }
24
24
 
25
- describe('parsePathPrefix', () => {
26
- it('splits on the first colon', () => {
27
- expect(parsePathPrefix('/var/www/html:/home/runner/work/site/site')).toEqual({
28
- from: '/var/www/html',
29
- to: '/home/runner/work/site/site',
30
- })
31
- })
32
-
33
- it('keeps a colon in the local path, as Windows drives have', () => {
34
- expect(parsePathPrefix('/var/www/html:C:/checkout')).toEqual({
35
- from: '/var/www/html',
36
- to: 'C:/checkout',
37
- })
38
- })
39
-
40
- it('rejects a value that is not a pair', () => {
41
- expect(parsePathPrefix('/var/www/html')).toBeNull()
42
- expect(parsePathPrefix(':/home/runner')).toBeNull()
43
- expect(parsePathPrefix('/var/www/html:')).toBeNull()
44
- })
45
- })
46
-
47
- describe('createPathResolver', () => {
48
- it('leaves a path that already resolves alone', () => {
49
- const filePath = touch('test/playwright/test-results/diff.png')
50
- const resolve = createPathResolver({ reportPath: path.join(tmpDir, 'results.json') })
51
-
52
- expect(resolve(filePath)).toEqual({ path: filePath, found: true })
53
- })
54
-
55
- it('re-roots a container path onto the checkout', () => {
56
- touch('test/playwright/test-results/home-chromium/home-1-diff.png')
25
+ describe("parsePathPrefix", () => {
26
+ it("splits on the first colon", () => {
27
+ expect(
28
+ parsePathPrefix("/var/www/html:/home/runner/work/site/site"),
29
+ ).toEqual({
30
+ from: "/var/www/html",
31
+ to: "/home/runner/work/site/site",
32
+ });
33
+ });
34
+
35
+ it("keeps a colon in the local path, as Windows drives have", () => {
36
+ expect(parsePathPrefix("/var/www/html:C:/checkout")).toEqual({
37
+ from: "/var/www/html",
38
+ to: "C:/checkout",
39
+ });
40
+ });
41
+
42
+ it("rejects a value that is not a pair", () => {
43
+ expect(parsePathPrefix("/var/www/html")).toBeNull();
44
+ expect(parsePathPrefix(":/home/runner")).toBeNull();
45
+ expect(parsePathPrefix("/var/www/html:")).toBeNull();
46
+ });
47
+ });
48
+
49
+ describe("createPathResolver", () => {
50
+ it("leaves a path that already resolves alone", () => {
51
+ const filePath = touch("test/playwright/test-results/diff.png");
57
52
  const resolve = createPathResolver({
58
- reportPath: path.join(tmpDir, 'test/playwright/test-results/results.json'),
59
- })
53
+ reportPath: path.join(tmpDir, "results.json"),
54
+ });
60
55
 
61
- const resolution = resolve(
62
- '/var/www/html/test/playwright/test-results/home-chromium/home-1-diff.png',
63
- )
56
+ expect(resolve(filePath)).toEqual({ path: filePath, found: true });
57
+ });
64
58
 
65
- expect(resolution.found).toBe(true)
66
- expect(resolution.path)
67
- .toBe(path.join(tmpDir, 'test/playwright/test-results/home-chromium/home-1-diff.png'))
68
- expect(resolution.prefix).toEqual({ from: '/var/www/html', to: tmpDir })
69
- })
59
+ it("re-roots a container path onto the checkout", () => {
60
+ touch("test/playwright/test-results/home-chromium/home-1-diff.png");
61
+ const resolve = createPathResolver({
62
+ reportPath: path.join(
63
+ tmpDir,
64
+ "test/playwright/test-results/results.json",
65
+ ),
66
+ });
70
67
 
71
- it('finds the files when the report sits outside the output directory', () => {
68
+ const resolution = resolve(
69
+ "/var/www/html/test/playwright/test-results/home-chromium/home-1-diff.png",
70
+ );
71
+
72
+ expect(resolution.found).toBe(true);
73
+ expect(resolution.path).toBe(
74
+ path.join(
75
+ tmpDir,
76
+ "test/playwright/test-results/home-chromium/home-1-diff.png",
77
+ ),
78
+ );
79
+ expect(resolution.prefix).toEqual({ from: "/var/www/html", to: tmpDir });
80
+ });
81
+
82
+ it("finds the files when the report sits outside the output directory", () => {
72
83
  // The arrangement the integration test produces: the report is written
73
84
  // beside the Playwright config while the images go to a separate output
74
85
  // directory, so the two share nothing but the mount point.
75
- touch('test/playwright/test-results-visual/fixture-chromium/fixture-diff.png')
86
+ touch(
87
+ "test/playwright/test-results-visual/fixture-chromium/fixture-diff.png",
88
+ );
76
89
  const resolve = createPathResolver({
77
- reportPath: path.join(tmpDir, 'test/playwright/visual-diff-results.json'),
78
- })
90
+ reportPath: path.join(tmpDir, "test/playwright/visual-diff-results.json"),
91
+ });
79
92
 
80
93
  const resolution = resolve(
81
- '/var/www/html/test/playwright/test-results-visual/fixture-chromium/fixture-diff.png',
82
- )
83
-
84
- expect(resolution.found).toBe(true)
85
- expect(resolution.path)
86
- .toBe(path.join(tmpDir, 'test/playwright/test-results-visual/fixture-chromium/fixture-diff.png'))
87
- })
88
-
89
- it('does not assume a fixed offset between the report and the mount point', () => {
94
+ "/var/www/html/test/playwright/test-results-visual/fixture-chromium/fixture-diff.png",
95
+ );
96
+
97
+ expect(resolution.found).toBe(true);
98
+ expect(resolution.path).toBe(
99
+ path.join(
100
+ tmpDir,
101
+ "test/playwright/test-results-visual/fixture-chromium/fixture-diff.png",
102
+ ),
103
+ );
104
+ });
105
+
106
+ it("does not assume a fixed offset between the report and the mount point", () => {
90
107
  // This repository's own CI creates the project under a generated directory,
91
108
  // so its depth below the workspace differs from the container's.
92
- touch('tmp/pwtest-abc123/test/playwright/test-results/home-chromium/home-1-diff.png')
109
+ touch(
110
+ "tmp/pwtest-abc123/test/playwright/test-results/home-chromium/home-1-diff.png",
111
+ );
93
112
  const resolve = createPathResolver({
94
- reportPath: path.join(tmpDir, 'tmp/pwtest-abc123/test/playwright/test-results/results.json'),
95
- })
113
+ reportPath: path.join(
114
+ tmpDir,
115
+ "tmp/pwtest-abc123/test/playwright/test-results/results.json",
116
+ ),
117
+ });
96
118
 
97
119
  const resolution = resolve(
98
- '/var/www/html/test/playwright/test-results/home-chromium/home-1-diff.png',
99
- )
120
+ "/var/www/html/test/playwright/test-results/home-chromium/home-1-diff.png",
121
+ );
100
122
 
101
- expect(resolution.found).toBe(true)
123
+ expect(resolution.found).toBe(true);
102
124
  expect(resolution.prefix).toEqual({
103
- from: '/var/www/html',
104
- to: path.join(tmpDir, 'tmp/pwtest-abc123'),
105
- })
106
- })
125
+ from: "/var/www/html",
126
+ to: path.join(tmpDir, "tmp/pwtest-abc123"),
127
+ });
128
+ });
107
129
 
108
- it('prefers the longest tail, so the most specific match wins', () => {
130
+ it("prefers the longest tail, so the most specific match wins", () => {
109
131
  // A shallow decoy sharing the last two components must not beat the real
110
132
  // file, which shares many more.
111
- touch('decoy/fixture-chromium/fixture-diff.png')
112
- touch('test/playwright/test-results/fixture-chromium/fixture-diff.png')
133
+ touch("decoy/fixture-chromium/fixture-diff.png");
134
+ touch("test/playwright/test-results/fixture-chromium/fixture-diff.png");
113
135
 
114
136
  const resolve = createPathResolver({
115
- reportPath: path.join(tmpDir, 'test/playwright/test-results/results.json'),
116
- })
117
-
118
- expect(resolve('/var/www/html/test/playwright/test-results/fixture-chromium/fixture-diff.png').path)
119
- .toBe(path.join(tmpDir, 'test/playwright/test-results/fixture-chromium/fixture-diff.png'))
120
- })
121
-
122
- it('will not identify a file by its name alone', () => {
137
+ reportPath: path.join(
138
+ tmpDir,
139
+ "test/playwright/test-results/results.json",
140
+ ),
141
+ });
142
+
143
+ expect(
144
+ resolve(
145
+ "/var/www/html/test/playwright/test-results/fixture-chromium/fixture-diff.png",
146
+ ).path,
147
+ ).toBe(
148
+ path.join(
149
+ tmpDir,
150
+ "test/playwright/test-results/fixture-chromium/fixture-diff.png",
151
+ ),
152
+ );
153
+ });
154
+
155
+ it("will not identify a file by its name alone", () => {
123
156
  // One component of tail is a coincidence waiting to happen: some unrelated
124
157
  // fixture-diff.png must not be served up as the failure's diff image.
125
- touch('fixture-diff.png')
126
- const resolve = createPathResolver({ reportPath: path.join(tmpDir, 'results.json') })
158
+ touch("fixture-diff.png");
159
+ const resolve = createPathResolver({
160
+ reportPath: path.join(tmpDir, "results.json"),
161
+ });
127
162
 
128
- expect(resolve('/var/www/html/somewhere/else/fixture-diff.png').found).toBe(false)
129
- })
163
+ expect(resolve("/var/www/html/somewhere/else/fixture-diff.png").found).toBe(
164
+ false,
165
+ );
166
+ });
130
167
 
131
- it('reports a path it cannot find rather than inventing one', () => {
168
+ it("reports a path it cannot find rather than inventing one", () => {
132
169
  const resolve = createPathResolver({
133
- reportPath: path.join(tmpDir, 'test/playwright/test-results/results.json'),
134
- })
170
+ reportPath: path.join(
171
+ tmpDir,
172
+ "test/playwright/test-results/results.json",
173
+ ),
174
+ });
135
175
 
136
- const resolution = resolve('/var/www/html/test/playwright/test-results/missing-diff.png')
176
+ const resolution = resolve(
177
+ "/var/www/html/test/playwright/test-results/missing-diff.png",
178
+ );
137
179
 
138
180
  expect(resolution).toEqual({
139
- path: '/var/www/html/test/playwright/test-results/missing-diff.png',
181
+ path: "/var/www/html/test/playwright/test-results/missing-diff.png",
140
182
  found: false,
141
- })
142
- })
183
+ });
184
+ });
143
185
 
144
- it('reuses a mapping it has already worked out', () => {
145
- touch('test-results/one/a-diff.png')
146
- touch('test-results/two/b-diff.png')
186
+ it("reuses a mapping it has already worked out", () => {
187
+ touch("test-results/one/a-diff.png");
188
+ touch("test-results/two/b-diff.png");
147
189
 
148
- const looked: string[] = []
190
+ const looked: string[] = [];
149
191
  const resolve = createPathResolver({
150
- reportPath: path.join(tmpDir, 'results.json'),
151
- exists: filePath => {
152
- looked.push(filePath)
153
- return fs.existsSync(filePath)
192
+ reportPath: path.join(tmpDir, "results.json"),
193
+ exists: (filePath) => {
194
+ looked.push(filePath);
195
+ return fs.existsSync(filePath);
154
196
  },
155
- })
197
+ });
156
198
 
157
- resolve('/var/www/html/test-results/one/a-diff.png')
158
- const afterFirst = looked.length
159
- looked.length = 0
199
+ resolve("/var/www/html/test-results/one/a-diff.png");
200
+ const afterFirst = looked.length;
201
+ looked.length = 0;
160
202
 
161
- expect(resolve('/var/www/html/test-results/two/b-diff.png').found).toBe(true)
203
+ expect(resolve("/var/www/html/test-results/two/b-diff.png").found).toBe(
204
+ true,
205
+ );
162
206
  // The learned mapping is tried straight after the original path, rather
163
207
  // than searching the tree again.
164
- expect(looked.length).toBeLessThan(afterFirst)
208
+ expect(looked.length).toBeLessThan(afterFirst);
165
209
  expect(looked).toEqual([
166
- '/var/www/html/test-results/two/b-diff.png',
167
- path.join(tmpDir, 'test-results/two/b-diff.png'),
168
- ])
169
- })
210
+ "/var/www/html/test-results/two/b-diff.png",
211
+ path.join(tmpDir, "test-results/two/b-diff.png"),
212
+ ]);
213
+ });
170
214
 
171
- it('prefers an explicit prefix over anything it would work out', () => {
172
- touch('elsewhere/test-results/home-1-diff.png')
173
- touch('test/playwright/test-results/home-1-diff.png')
215
+ it("prefers an explicit prefix over anything it would work out", () => {
216
+ touch("elsewhere/test-results/home-1-diff.png");
217
+ touch("test/playwright/test-results/home-1-diff.png");
174
218
 
175
219
  const resolve = createPathResolver({
176
- reportPath: path.join(tmpDir, 'test/playwright/test-results/results.json'),
177
- prefixes: [{ from: '/var/www/html/test/playwright', to: path.join(tmpDir, 'elsewhere') }],
178
- })
179
-
180
- expect(resolve('/var/www/html/test/playwright/test-results/home-1-diff.png').path)
181
- .toBe(path.join(tmpDir, 'elsewhere/test-results/home-1-diff.png'))
182
- })
183
-
184
- it('ignores a prefix the path is not under', () => {
185
- touch('test-results/diff.png')
220
+ reportPath: path.join(
221
+ tmpDir,
222
+ "test/playwright/test-results/results.json",
223
+ ),
224
+ prefixes: [
225
+ {
226
+ from: "/var/www/html/test/playwright",
227
+ to: path.join(tmpDir, "elsewhere"),
228
+ },
229
+ ],
230
+ });
231
+
232
+ expect(
233
+ resolve("/var/www/html/test/playwright/test-results/home-1-diff.png")
234
+ .path,
235
+ ).toBe(path.join(tmpDir, "elsewhere/test-results/home-1-diff.png"));
236
+ });
237
+
238
+ it("ignores a prefix the path is not under", () => {
239
+ touch("test-results/diff.png");
186
240
  const resolve = createPathResolver({
187
- reportPath: path.join(tmpDir, 'results.json'),
188
- prefixes: [{ from: '/somewhere/else', to: tmpDir }],
189
- })
241
+ reportPath: path.join(tmpDir, "results.json"),
242
+ prefixes: [{ from: "/somewhere/else", to: tmpDir }],
243
+ });
190
244
 
191
245
  // The explicit prefix does not apply, and one component of tail is too
192
246
  // little to search on.
193
- expect(resolve('/var/www/html/diff.png').found).toBe(false)
194
- })
247
+ expect(resolve("/var/www/html/diff.png").found).toBe(false);
248
+ });
195
249
 
196
- it('does not match a prefix part way through a directory name', () => {
197
- touch('results/diff.png')
250
+ it("does not match a prefix part way through a directory name", () => {
251
+ touch("results/diff.png");
198
252
  const resolve = createPathResolver({
199
- reportPath: path.join(tmpDir, 'results.json'),
200
- prefixes: [{ from: '/var/www/ht', to: tmpDir }],
201
- })
253
+ reportPath: path.join(tmpDir, "results.json"),
254
+ prefixes: [{ from: "/var/www/ht", to: tmpDir }],
255
+ });
202
256
 
203
257
  // /var/www/html starts with the string /var/www/ht but is not under it,
204
258
  // so the explicit mapping must not fire. The search still finds the file.
205
- const resolution = resolve('/var/www/html/results/diff.png')
206
- expect(resolution.path).toBe(path.join(tmpDir, 'results/diff.png'))
207
- expect(resolution.prefix).toEqual({ from: '/var/www/html', to: tmpDir })
208
- })
259
+ const resolution = resolve("/var/www/html/results/diff.png");
260
+ expect(resolution.path).toBe(path.join(tmpDir, "results/diff.png"));
261
+ expect(resolution.prefix).toEqual({ from: "/var/www/html", to: tmpDir });
262
+ });
209
263
 
210
- it('tolerates trailing slashes on the local side', () => {
211
- touch('test-results/diff.png')
264
+ it("tolerates trailing slashes on the local side", () => {
265
+ touch("test-results/diff.png");
212
266
  const resolve = createPathResolver({
213
- reportPath: path.join(tmpDir, 'results.json'),
267
+ reportPath: path.join(tmpDir, "results.json"),
214
268
  // A run of them, not just one: the trim is an index scan rather than a
215
269
  // regex, because `/[\\/]+$/` backtracks quadratically over exactly this.
216
- prefixes: [{ from: '/var/www/html', to: `${tmpDir}///` }],
217
- })
218
-
219
- expect(resolve('/var/www/html/test-results/diff.png').path)
220
- .toBe(`${tmpDir}/test-results/diff.png`)
221
- })
222
- })
270
+ prefixes: [{ from: "/var/www/html", to: `${tmpDir}///` }],
271
+ });
272
+
273
+ expect(resolve("/var/www/html/test-results/diff.png").path).toBe(
274
+ `${tmpDir}/test-results/diff.png`,
275
+ );
276
+ });
277
+ });