Skip to content

Commit 0f9f614

Browse files
committed
tests: replace $0 in cli-flag snapshots
1 parent 72b0d6b commit 0f9f614

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

lighthouse-cli/test/cli/__snapshots__/cli-flags-test.js.snap

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`CLI flags array values do not support csv when appropriate 1`] = `
44
Object {
5-
"$0": "node_modules/jest/bin/jest.js",
5+
"$0": "__REPLACED__",
66
"_": Array [
77
"http://www.example.com",
88
],
@@ -48,7 +48,7 @@ Object {
4848

4949
exports[`CLI flags array values support csv when appropriate 1`] = `
5050
Object {
51-
"$0": "node_modules/jest/bin/jest.js",
51+
"$0": "__REPLACED__",
5252
"_": Array [
5353
"http://www.example.com",
5454
],
@@ -100,7 +100,7 @@ Object {
100100

101101
exports[`CLI flags extraHeaders should convert extra headers to object 1`] = `
102102
Object {
103-
"$0": "node_modules/jest/bin/jest.js",
103+
"$0": "__REPLACED__",
104104
"_": Array [
105105
"http://www.example.com",
106106
],
@@ -140,7 +140,7 @@ Object {
140140

141141
exports[`CLI flags extraHeaders should read extra headers from file 1`] = `
142142
Object {
143-
"$0": "node_modules/jest/bin/jest.js",
143+
"$0": "__REPLACED__",
144144
"_": Array [
145145
"http://www.example.com",
146146
],
@@ -182,7 +182,7 @@ Object {
182182

183183
exports[`CLI flags screenEmulation deviceScaleFactor parses a non-integer numeric value 1`] = `
184184
Object {
185-
"$0": "node_modules/jest/bin/jest.js",
185+
"$0": "__REPLACED__",
186186
"_": Array [
187187
"http://www.example.com",
188188
],
@@ -230,7 +230,7 @@ Object {
230230

231231
exports[`CLI flags screenEmulation disabled parses the flag with no value as true 1`] = `
232232
Object {
233-
"$0": "node_modules/jest/bin/jest.js",
233+
"$0": "__REPLACED__",
234234
"_": Array [
235235
"http://www.example.com",
236236
],
@@ -278,7 +278,7 @@ Object {
278278

279279
exports[`CLI flags screenEmulation mobile parses the flag with no value as true 1`] = `
280280
Object {
281-
"$0": "node_modules/jest/bin/jest.js",
281+
"$0": "__REPLACED__",
282282
"_": Array [
283283
"http://www.example.com",
284284
],
@@ -326,7 +326,7 @@ Object {
326326

327327
exports[`CLI flags screenEmulation width parses a number value 1`] = `
328328
Object {
329-
"$0": "node_modules/jest/bin/jest.js",
329+
"$0": "__REPLACED__",
330330
"_": Array [
331331
"http://www.example.com",
332332
],
@@ -374,7 +374,7 @@ Object {
374374

375375
exports[`CLI flags settings are accepted from a file path (inlined budgets) 1`] = `
376376
Object {
377-
"$0": "node_modules/jest/bin/jest.js",
377+
"$0": "__REPLACED__",
378378
"_": Array [
379379
"http://www.example.com",
380380
],
@@ -415,7 +415,7 @@ Object {
415415

416416
exports[`CLI flags settings are accepted from a file path 1`] = `
417417
Object {
418-
"$0": "node_modules/jest/bin/jest.js",
418+
"$0": "__REPLACED__",
419419
"_": Array [
420420
"http://www.example.com",
421421
],

lighthouse-cli/test/cli/cli-flags-test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ function snapshot(flags) {
3030
.replace(/\\/g, '/');
3131
}
3232
}
33+
// Command changes depending on how test was run, so remove.
34+
// @ts-expect-error - '$0' not in CliFlags type.
35+
flags.$0 = '__REPLACED__';
3336

3437
expect(flags).toMatchSnapshot();
3538
}

0 commit comments

Comments
 (0)