Skip to content

Commit 1571c58

Browse files
author
Brian Vaughn
committed
Updated test snapshots
1 parent 664d65b commit 1571c58

File tree

6 files changed

+4521
-575
lines changed

6 files changed

+4521
-575
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ describe('Timeline profiler', () => {
3333
// Remove file-system specific bits or version-specific bits of information from the module range marks.
3434
function filterMarkData(markName) {
3535
if (markName.startsWith('--react-internal-module-start')) {
36-
return `${markName.substr(0, 29)}-<filtered-file-system-path>`;
36+
return '--react-internal-module-start-<filtered-file-system-path>';
3737
} else if (markName.startsWith('--react-internal-module-stop')) {
38-
return `${markName.substr(0, 28)}-<filtered-file-system-path>`;
38+
return '--react-internal-module-stop-<filtered-file-system-path>';
3939
} else if (markName.startsWith('--react-version')) {
40-
return `${markName.substr(0, 15)}-<filtered-version>`;
40+
return '--react-version-<filtered-version>';
4141
} else {
4242
return markName;
4343
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import hasOwnProperty from 'shared/hasOwnProperty';
2+
3+
const FILTERED_VERSION_STRING = '<filtered-version>';
4+
5+
// test() is part of Jest's serializer API
6+
export function test(maybeProfile) {
7+
if (
8+
maybeProfile != null &&
9+
typeof maybeProfile === 'object' &&
10+
hasOwnProperty.call(maybeProfile, 'reactVersion') &&
11+
maybeProfile.reactVersion !== FILTERED_VERSION_STRING
12+
) {
13+
return true;
14+
}
15+
16+
return false;
17+
}
18+
19+
// print() is part of Jest's serializer API
20+
export function print(profile, serialize, indent) {
21+
return serialize({
22+
...profile,
23+
reactVersion: FILTERED_VERSION_STRING,
24+
});
25+
}

0 commit comments

Comments
 (0)