Skip to content

Commit

Permalink
Updated test snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Jan 27, 2022
1 parent 664d65b commit 1571c58
Show file tree
Hide file tree
Showing 6 changed files with 4,521 additions and 575 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ describe('Timeline profiler', () => {
// Remove file-system specific bits or version-specific bits of information from the module range marks.
function filterMarkData(markName) {
if (markName.startsWith('--react-internal-module-start')) {
return `${markName.substr(0, 29)}-<filtered-file-system-path>`;
return '--react-internal-module-start-<filtered-file-system-path>';
} else if (markName.startsWith('--react-internal-module-stop')) {
return `${markName.substr(0, 28)}-<filtered-file-system-path>`;
return '--react-internal-module-stop-<filtered-file-system-path>';
} else if (markName.startsWith('--react-version')) {
return `${markName.substr(0, 15)}-<filtered-version>`;
return '--react-version-<filtered-version>';
} else {
return markName;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import hasOwnProperty from 'shared/hasOwnProperty';

const FILTERED_VERSION_STRING = '<filtered-version>';

// test() is part of Jest's serializer API
export function test(maybeProfile) {
if (
maybeProfile != null &&
typeof maybeProfile === 'object' &&
hasOwnProperty.call(maybeProfile, 'reactVersion') &&
maybeProfile.reactVersion !== FILTERED_VERSION_STRING
) {
return true;
}

return false;
}

// print() is part of Jest's serializer API
export function print(profile, serialize, indent) {
return serialize({
...profile,
reactVersion: FILTERED_VERSION_STRING,
});
}
Loading

0 comments on commit 1571c58

Please sign in to comment.