Skip to content

Commit 4e8b7c5

Browse files
author
Brian Vaughn
committed
Removed version-specific info from Timeline data snapshot tests
1 parent 31ca382 commit 4e8b7c5

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

packages/react-devtools-shared/src/__tests__/timelineProfiler-test.js renamed to packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,30 @@ describe('Timeline profiler', () => {
2929
clearedMarks = [];
3030
marks = [];
3131

32-
// Remove file-system specific bits of information from the module range marks.
33-
function filterModuleRanges(markName) {
32+
// Remove file-system specific bits or version-specific bits of information from the module range marks.
33+
function filterMarkData(markName) {
3434
if (markName.startsWith('--react-internal-module-start')) {
3535
return `${markName.substr(0, 29)}-<filtered-file-system-path>`;
3636
} else if (markName.startsWith('--react-internal-module-stop')) {
3737
return `${markName.substr(0, 28)}-<filtered-file-system-path>`;
38+
} else if (markName.startsWith('--react-version')) {
39+
return `${markName.substr(0, 15)}-<filtered-version>`;
40+
} else {
41+
return markName;
3842
}
3943
}
4044

4145
// This is not a true polyfill, but it gives us enough to capture marks.
4246
// Reference: https://developer.mozilla.org/en-US/docs/Web/API/User_Timing_API
4347
return {
4448
clearMarks(markName) {
45-
if (markName.startsWith('--react-internal-module')) {
46-
markName = filterModuleRanges(markName);
47-
}
49+
markName = filterMarkData(markName);
4850

4951
clearedMarks.push(markName);
5052
marks = marks.filter(mark => mark !== markName);
5153
},
5254
mark(markName, markOptions) {
53-
if (markName.startsWith('--react-internal-module')) {
54-
markName = filterModuleRanges(markName);
55-
}
55+
markName = filterMarkData(markName);
5656

5757
if (featureDetectionMarkName === null) {
5858
featureDetectionMarkName = markName;
@@ -127,7 +127,7 @@ describe('Timeline profiler', () => {
127127
"--render-start-1",
128128
"--render-stop",
129129
"--commit-start-1",
130-
"--react-version-17.0.3",
130+
"--react-version-<filtered-version>",
131131
"--profiler-version-1",
132132
"--react-internal-module-start-<filtered-file-system-path>",
133133
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -157,7 +157,7 @@ describe('Timeline profiler', () => {
157157
"--render-start-16",
158158
"--render-stop",
159159
"--commit-start-16",
160-
"--react-version-17.0.3",
160+
"--react-version-<filtered-version>",
161161
"--profiler-version-1",
162162
"--react-internal-module-start-<filtered-file-system-path>",
163163
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -219,7 +219,7 @@ describe('Timeline profiler', () => {
219219
"--suspense-suspend-0-Example-mount-1-",
220220
"--render-stop",
221221
"--commit-start-1",
222-
"--react-version-17.0.3",
222+
"--react-version-<filtered-version>",
223223
"--profiler-version-1",
224224
"--react-internal-module-start-<filtered-file-system-path>",
225225
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -261,7 +261,7 @@ describe('Timeline profiler', () => {
261261
"--suspense-suspend-0-Example-mount-1-",
262262
"--render-stop",
263263
"--commit-start-1",
264-
"--react-version-17.0.3",
264+
"--react-version-<filtered-version>",
265265
"--profiler-version-1",
266266
"--react-internal-module-start-<filtered-file-system-path>",
267267
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -308,7 +308,7 @@ describe('Timeline profiler', () => {
308308
"--suspense-suspend-0-Example-mount-16-",
309309
"--render-stop",
310310
"--commit-start-16",
311-
"--react-version-17.0.3",
311+
"--react-version-<filtered-version>",
312312
"--profiler-version-1",
313313
"--react-internal-module-start-<filtered-file-system-path>",
314314
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -359,7 +359,7 @@ describe('Timeline profiler', () => {
359359
"--suspense-suspend-0-Example-mount-16-",
360360
"--render-stop",
361361
"--commit-start-16",
362-
"--react-version-17.0.3",
362+
"--react-version-<filtered-version>",
363363
"--profiler-version-1",
364364
"--react-internal-module-start-<filtered-file-system-path>",
365365
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -410,7 +410,7 @@ describe('Timeline profiler', () => {
410410
"--component-render-stop",
411411
"--render-stop",
412412
"--commit-start-16",
413-
"--react-version-17.0.3",
413+
"--react-version-<filtered-version>",
414414
"--profiler-version-1",
415415
"--react-internal-module-start-<filtered-file-system-path>",
416416
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -423,7 +423,7 @@ describe('Timeline profiler', () => {
423423
"--component-render-stop",
424424
"--render-stop",
425425
"--commit-start-1",
426-
"--react-version-17.0.3",
426+
"--react-version-<filtered-version>",
427427
"--profiler-version-1",
428428
"--react-internal-module-start-<filtered-file-system-path>",
429429
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -463,7 +463,7 @@ describe('Timeline profiler', () => {
463463
"--component-render-stop",
464464
"--render-stop",
465465
"--commit-start-16",
466-
"--react-version-17.0.3",
466+
"--react-version-<filtered-version>",
467467
"--profiler-version-1",
468468
"--react-internal-module-start-<filtered-file-system-path>",
469469
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -476,7 +476,7 @@ describe('Timeline profiler', () => {
476476
"--component-render-stop",
477477
"--render-stop",
478478
"--commit-start-1",
479-
"--react-version-17.0.3",
479+
"--react-version-<filtered-version>",
480480
"--profiler-version-1",
481481
"--react-internal-module-start-<filtered-file-system-path>",
482482
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -528,7 +528,7 @@ describe('Timeline profiler', () => {
528528
"--component-render-stop",
529529
"--render-stop",
530530
"--commit-start-16",
531-
"--react-version-17.0.3",
531+
"--react-version-<filtered-version>",
532532
"--profiler-version-1",
533533
"--react-internal-module-start-<filtered-file-system-path>",
534534
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -581,7 +581,7 @@ describe('Timeline profiler', () => {
581581
"--component-render-stop",
582582
"--render-stop",
583583
"--commit-start-16",
584-
"--react-version-17.0.3",
584+
"--react-version-<filtered-version>",
585585
"--profiler-version-1",
586586
"--react-internal-module-start-<filtered-file-system-path>",
587587
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -621,7 +621,7 @@ describe('Timeline profiler', () => {
621621
"--component-render-stop",
622622
"--render-stop",
623623
"--commit-start-16",
624-
"--react-version-17.0.3",
624+
"--react-version-<filtered-version>",
625625
"--profiler-version-1",
626626
"--react-internal-module-start-<filtered-file-system-path>",
627627
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -636,7 +636,7 @@ describe('Timeline profiler', () => {
636636
"--component-render-stop",
637637
"--render-stop",
638638
"--commit-start-1",
639-
"--react-version-17.0.3",
639+
"--react-version-<filtered-version>",
640640
"--profiler-version-1",
641641
"--react-internal-module-start-<filtered-file-system-path>",
642642
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -670,7 +670,7 @@ describe('Timeline profiler', () => {
670670
"--component-render-stop",
671671
"--render-stop",
672672
"--commit-start-16",
673-
"--react-version-17.0.3",
673+
"--react-version-<filtered-version>",
674674
"--profiler-version-1",
675675
"--react-internal-module-start-<filtered-file-system-path>",
676676
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -688,7 +688,7 @@ describe('Timeline profiler', () => {
688688
"--component-render-stop",
689689
"--render-stop",
690690
"--commit-start-16",
691-
"--react-version-17.0.3",
691+
"--react-version-<filtered-version>",
692692
"--profiler-version-1",
693693
"--react-internal-module-start-<filtered-file-system-path>",
694694
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -720,7 +720,7 @@ describe('Timeline profiler', () => {
720720
"--component-render-stop",
721721
"--render-stop",
722722
"--commit-start-16",
723-
"--react-version-17.0.3",
723+
"--react-version-<filtered-version>",
724724
"--profiler-version-1",
725725
"--react-internal-module-start-<filtered-file-system-path>",
726726
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -770,7 +770,7 @@ describe('Timeline profiler', () => {
770770
"--error-ExampleThatThrows-mount-Expected error",
771771
"--render-stop",
772772
"--commit-start-1",
773-
"--react-version-17.0.3",
773+
"--react-version-<filtered-version>",
774774
"--profiler-version-1",
775775
"--react-internal-module-start-<filtered-file-system-path>",
776776
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -784,7 +784,7 @@ describe('Timeline profiler', () => {
784784
"--component-render-stop",
785785
"--render-stop",
786786
"--commit-start-1",
787-
"--react-version-17.0.3",
787+
"--react-version-<filtered-version>",
788788
"--profiler-version-1",
789789
"--react-internal-module-start-<filtered-file-system-path>",
790790
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -850,7 +850,7 @@ describe('Timeline profiler', () => {
850850
"--error-ExampleThatThrows-mount-Expected error",
851851
"--render-stop",
852852
"--commit-start-16",
853-
"--react-version-17.0.3",
853+
"--react-version-<filtered-version>",
854854
"--profiler-version-1",
855855
"--react-internal-module-start-<filtered-file-system-path>",
856856
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -863,7 +863,7 @@ describe('Timeline profiler', () => {
863863
"--component-render-stop",
864864
"--render-stop",
865865
"--commit-start-1",
866-
"--react-version-17.0.3",
866+
"--react-version-<filtered-version>",
867867
"--profiler-version-1",
868868
"--react-internal-module-start-<filtered-file-system-path>",
869869
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -929,7 +929,7 @@ describe('Timeline profiler', () => {
929929
"--component-render-stop",
930930
"--render-stop",
931931
"--commit-start-16",
932-
"--react-version-17.0.3",
932+
"--react-version-<filtered-version>",
933933
"--profiler-version-1",
934934
"--react-internal-module-start-<filtered-file-system-path>",
935935
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -985,7 +985,7 @@ describe('Timeline profiler', () => {
985985
"--render-start-1",
986986
"--render-stop",
987987
"--commit-start-1",
988-
"--react-version-17.0.3",
988+
"--react-version-<filtered-version>",
989989
"--profiler-version-1",
990990
"--react-internal-module-start-<filtered-file-system-path>",
991991
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -1019,7 +1019,7 @@ describe('Timeline profiler', () => {
10191019
"--render-start-1",
10201020
"--render-stop",
10211021
"--commit-start-1",
1022-
"--react-version-17.0.3",
1022+
"--react-version-<filtered-version>",
10231023
"--profiler-version-1",
10241024
"--react-internal-module-start-<filtered-file-system-path>",
10251025
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -1069,7 +1069,7 @@ describe('Timeline profiler', () => {
10691069
"--component-render-stop",
10701070
"--render-stop",
10711071
"--commit-start-1",
1072-
"--react-version-17.0.3",
1072+
"--react-version-<filtered-version>",
10731073
"--profiler-version-1",
10741074
"--react-internal-module-start-<filtered-file-system-path>",
10751075
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -1109,7 +1109,7 @@ describe('Timeline profiler', () => {
11091109
"--component-render-stop",
11101110
"--render-stop",
11111111
"--commit-start-4",
1112-
"--react-version-17.0.3",
1112+
"--react-version-<filtered-version>",
11131113
"--profiler-version-1",
11141114
"--react-internal-module-start-<filtered-file-system-path>",
11151115
"--react-internal-module-stop-<filtered-file-system-path>",

0 commit comments

Comments
 (0)