Skip to content

Commit

Permalink
Gate devtools tests
Browse files Browse the repository at this point in the history
Following precedence in console-test.
  • Loading branch information
sebmarkbage committed Sep 15, 2024
1 parent e20ab2a commit 406cd4f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import {
import {ReactVersion} from '../../../../ReactVersions';
import semver from 'semver';

let React = require('react');
let Scheduler;
let store;
let utils;

// TODO: This is how other DevTools tests access the version but we should find
// a better solution for this
const ReactVersionTestingAgainst = process.env.REACT_VERSION || ReactVersion;
Expand All @@ -26,11 +31,16 @@ const ReactVersionTestingAgainst = process.env.REACT_VERSION || ReactVersion;
const enableSiblingPrerendering =
false && semver.gte(ReactVersionTestingAgainst, '19.0.0');

// This flag is on experimental which disables timeline profiler.
const enableComponentPerformanceTrack =
React.version.startsWith('19') && React.version.includes('experimental');

describe('Timeline profiler', () => {
let React;
let Scheduler;
let store;
let utils;
if (enableComponentPerformanceTrack) {
test('no tests', () => {});
// Ignore all tests.
return;
}

beforeEach(() => {
utils = require('./utils');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,29 @@ import {ReactVersion} from '../../../../ReactVersions';

const ReactVersionTestingAgainst = process.env.REACT_VERSION || ReactVersion;

let React = require('react');
let ReactDOM;
let ReactDOMClient;
let Scheduler;
let utils;
let assertLog;
let waitFor;

// This flag is on experimental which disables timeline profiler.
const enableComponentPerformanceTrack =
React.version.startsWith('19') && React.version.includes('experimental');

describe('Timeline profiler', () => {
let React;
let ReactDOM;
let ReactDOMClient;
let Scheduler;
let utils;
let assertLog;
let waitFor;
if (enableComponentPerformanceTrack) {
test('no tests', () => {});
// Ignore all tests.
return;
}

describe('User Timing API', () => {
if (enableComponentPerformanceTrack) {
return;
}
let currentlyNotClearedMarks;
let registeredMarks;
let featureDetectionMarkName = null;
Expand Down

0 comments on commit 406cd4f

Please sign in to comment.