Skip to content

Commit

Permalink
fix[react-devtools]: fixed timeline profiler tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxyq committed Oct 14, 2024
1 parent 13411e4 commit 7bf3c5c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1280,13 +1280,13 @@ describe('Timeline profiler', () => {
});

describe('when profiling', () => {
beforeEach(() => {
utils.act(() => store.profilerStore.startProfiling());
});

describe('with legacy render', () => {
const {render: legacyRender} = getLegacyRenderImplementation();

beforeEach(() => {
utils.act(() => store.profilerStore.startProfiling());
});

// @reactVersion <= 18.2
// @reactVersion >= 18.0
it('should mark sync render without suspends or state updates', () => {
Expand Down Expand Up @@ -1537,6 +1537,10 @@ describe('Timeline profiler', () => {

const {render: modernRender} = getModernRenderImplementation();

beforeEach(() => {
utils.act(() => store.profilerStore.startProfiling());
});

it('should mark concurrent render without suspends or state updates', () => {
utils.act(() => modernRender(<div />));

Expand Down
4 changes: 3 additions & 1 deletion packages/react-devtools-shared/src/__tests__/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ beforeEach(() => {
},
});

const store = new Store(((bridge: any): FrontendBridge));
const store = new Store(((bridge: any): FrontendBridge), {
supportsTimeline: true,
});

const agent = new Agent(((bridge: any): BackendBridge));
const hook = global.__REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down

0 comments on commit 7bf3c5c

Please sign in to comment.