Commit 00a1943
test_runner: add t.assert.fileSnapshot()
This commit adds a t.assert.fileSnapshot() API to the test runner.
This is similar to how snapshot tests work in core, as well as
userland options such as toMatchFileSnapshot().
PR-URL: #56459
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>1 parent eb2bf46 commit 00a1943Copy full SHA for 00a1943
File tree
Expand file treeCollapse file tree
6 files changed
+235
-32
lines changedOpen diff view settings
Filter options
- doc/api
- lib/internal/test_runner
- test
- fixtures/test-runner/snapshots
- parallel
Expand file treeCollapse file tree
6 files changed
+235
-32
lines changedOpen diff view settings
Collapse file
+37Lines changed: 37 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3278 | 3278 | |
3279 | 3279 | |
3280 | 3280 | |
| 3281 | + |
| 3282 | + |
| 3283 | + |
| 3284 | + |
| 3285 | + |
| 3286 | + |
| 3287 | + |
| 3288 | + |
| 3289 | + |
| 3290 | + |
| 3291 | + |
| 3292 | + |
| 3293 | + |
| 3294 | + |
| 3295 | + |
| 3296 | + |
| 3297 | + |
| 3298 | + |
| 3299 | + |
| 3300 | + |
| 3301 | + |
| 3302 | + |
| 3303 | + |
| 3304 | + |
| 3305 | + |
| 3306 | + |
| 3307 | + |
| 3308 | + |
| 3309 | + |
| 3310 | + |
| 3311 | + |
| 3312 | + |
| 3313 | + |
| 3314 | + |
| 3315 | + |
| 3316 | + |
| 3317 | + |
3281 | 3318 | |
3282 | 3319 | |
3283 | 3320 | |
|
Collapse file
lib/internal/test_runner/snapshot.js
Copy file name to clipboardExpand all lines: lib/internal/test_runner/snapshot.js+87-28Lines changed: 87 additions & 28 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
23 | 23 | |
24 | 24 | |
25 | 25 | |
| 26 | + |
26 | 27 | |
27 | 28 | |
28 | 29 | |
| ||
109 | 110 | |
110 | 111 | |
111 | 112 | |
112 | | - |
113 | | - |
114 | | - |
115 | | - |
116 | | - |
117 | | - |
118 | | - |
119 | | - |
120 | | - |
121 | | - |
| 113 | + |
122 | 114 | |
123 | 115 | |
124 | 116 | |
| ||
132 | 124 | |
133 | 125 | |
134 | 126 | |
135 | | - |
136 | | - |
137 | | - |
138 | | - |
139 | | - |
| 127 | + |
140 | 128 | |
141 | 129 | |
142 | 130 | |
| ||
171 | 159 | |
172 | 160 | |
173 | 161 | |
174 | | - |
175 | | - |
176 | | - |
177 | | - |
178 | | - |
179 | | - |
180 | | - |
| 162 | + |
181 | 163 | |
182 | 164 | |
183 | | - |
184 | | - |
185 | | - |
186 | | - |
187 | | - |
188 | | - |
| 165 | + |
| 166 | + |
| 167 | + |
| 168 | + |
| 169 | + |
| 170 | + |
| 171 | + |
| 172 | + |
| 173 | + |
189 | 174 | |
190 | 175 | |
191 | 176 | |
| ||
222 | 207 | |
223 | 208 | |
224 | 209 | |
| 210 | + |
| 211 | + |
| 212 | + |
| 213 | + |
| 214 | + |
| 215 | + |
| 216 | + |
| 217 | + |
| 218 | + |
| 219 | + |
| 220 | + |
| 221 | + |
| 222 | + |
| 223 | + |
| 224 | + |
| 225 | + |
| 226 | + |
| 227 | + |
| 228 | + |
| 229 | + |
| 230 | + |
| 231 | + |
| 232 | + |
| 233 | + |
| 234 | + |
| 235 | + |
| 236 | + |
| 237 | + |
| 238 | + |
| 239 | + |
| 240 | + |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | + |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | + |
| 249 | + |
| 250 | + |
| 251 | + |
| 252 | + |
| 253 | + |
| 254 | + |
| 255 | + |
| 256 | + |
| 257 | + |
| 258 | + |
| 259 | + |
| 260 | + |
| 261 | + |
| 262 | + |
| 263 | + |
| 264 | + |
| 265 | + |
| 266 | + |
| 267 | + |
| 268 | + |
| 269 | + |
| 270 | + |
| 271 | + |
| 272 | + |
| 273 | + |
| 274 | + |
| 275 | + |
| 276 | + |
| 277 | + |
| 278 | + |
| 279 | + |
| 280 | + |
| 281 | + |
| 282 | + |
| 283 | + |
225 | 284 | |
226 | 285 | |
227 | 286 | |
|
Collapse file
lib/internal/test_runner/test.js
Copy file name to clipboardExpand all lines: lib/internal/test_runner/test.js+7-3Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
101 | 101 | |
102 | 102 | |
103 | 103 | |
| 104 | + |
104 | 105 | |
105 | 106 | |
106 | | - |
107 | | - |
| 107 | + |
108 | 108 | |
109 | | - |
| 109 | + |
110 | 110 | |
111 | 111 | |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
112 | 116 | |
113 | 117 | |
114 | 118 | |
|
Collapse file
test/fixtures/test-runner/snapshots/file-snapshots.js
Copy file name to clipboard+21Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
Collapse file
test/parallel/test-runner-assert.js
Copy file name to clipboardExpand all lines: test/parallel/test-runner-assert.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
10 | 10 | |
11 | 11 | |
12 | 12 | |
13 | | - |
| 13 | + |
14 | 14 | |
15 | 15 | |
16 | 16 | |
|
Collapse file
test/parallel/test-runner-snapshot-file-tests.js
Copy file name to clipboard+82Lines changed: 82 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
0 commit comments