Skip to content

Commit

Permalink
Fix TypeScript tests
Browse files Browse the repository at this point in the history
Summary:
I fixed the TypeScript definitions for Systrace in a0f56ad, but I forgot to update the TypeScript tests that were outdated. This diff fixes those tests and CI in OSS.

Changelog: [internal]

Reviewed By: cipolleschi

Differential Revision: D40141920

fbshipit-source-id: f73501450af0be6b0b6f836b9a774abb1fa4f620
  • Loading branch information
rubennorte authored and facebook-github-bot committed Oct 6, 2022
1 parent c9e6a60 commit 40567c2
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions types/__typetests__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,21 @@ const AppStateExample = () => {
);
};

const profiledJSONParse = Systrace.measure('JSON', 'parse', JSON.parse);
profiledJSONParse('[]');
if (Systrace.isEnabled()) {
const cookie = Systrace.beginAsyncEvent('async-event');
Systrace.endAsyncEvent('async-event', cookie);

const cookie2 = Systrace.beginAsyncEvent('async-event-2', {foo: '123'});
Systrace.endAsyncEvent('async-event-2', cookie2, {bar: '456'});

Systrace.beginEvent('sync-event');
Systrace.endEvent();

Systrace.beginEvent('sync-event-2', {key: 'value'});
Systrace.endEvent({key: 'other-value'});

Systrace.counterEvent('counter', 123);
}

InteractionManager.runAfterInteractions(() => {
// ...
Expand Down

0 comments on commit 40567c2

Please sign in to comment.