diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ec3a662..22d0c9bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: test: needs: [install-cache-deps] runs-on: ubuntu-latest - name: Test + name: Test (concurrent by default) steps: - name: Checkout uses: actions/checkout@v4 @@ -61,11 +61,10 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 - - test-concurrent: + test-legacy: needs: [install-cache-deps] runs-on: ubuntu-latest - name: Test (concurrent mode) + name: Test (legacy) steps: - name: Checkout uses: actions/checkout@v4 @@ -74,7 +73,7 @@ jobs: uses: ./.github/actions/setup-deps - name: Test in concurrent mode - run: CONCURRENT_MODE=1 yarn test:ci + run: CONCURRENT_MODE=0 yarn test:ci test-website: runs-on: ubuntu-latest diff --git a/jest-setup.ts b/jest-setup.ts index 9ed60181..868f7ba8 100644 --- a/jest-setup.ts +++ b/jest-setup.ts @@ -3,7 +3,7 @@ import './src/matchers/extend-expect'; beforeEach(() => { resetToDefaults(); - if (process.env.CONCURRENT_MODE === '1') { - configure({ concurrentRoot: true }); + if (process.env.CONCURRENT_MODE === '0') { + configure({ concurrentRoot: false }); } }); diff --git a/src/__tests__/config.test.ts b/src/__tests__/config.test.ts index b3d2a7ed..d20f9170 100644 --- a/src/__tests__/config.test.ts +++ b/src/__tests__/config.test.ts @@ -16,7 +16,7 @@ test('configure() overrides existing config values', () => { asyncUtilTimeout: 5000, defaultDebugOptions: { message: 'debug message' }, defaultIncludeHiddenElements: false, - concurrentRoot: false, + concurrentRoot: true, }); }); diff --git a/src/config.ts b/src/config.ts index cd0bf1bb..74296337 100644 --- a/src/config.ts +++ b/src/config.ts @@ -15,8 +15,8 @@ export type Config = { defaultDebugOptions?: Partial; /** - * Set to `true` to enable concurrent rendering. - * Otherwise `render` will default to legacy synchronous rendering. + * Set to `false` to disable concurrent rendering. + * Otherwise `render` will default to concurrent rendering. */ concurrentRoot: boolean; }; @@ -43,7 +43,7 @@ export type InternalConfig = Config & { const defaultConfig: InternalConfig = { asyncUtilTimeout: 1000, defaultIncludeHiddenElements: false, - concurrentRoot: false, + concurrentRoot: true, }; let config = { ...defaultConfig }; diff --git a/src/render.tsx b/src/render.tsx index acdd9511..7727130c 100644 --- a/src/render.tsx +++ b/src/render.tsx @@ -24,10 +24,10 @@ export interface RenderOptions { wrapper?: React.ComponentType; /** - * Set to `true` to enable concurrent rendering. - * Otherwise `render` will default to legacy synchronous rendering. + * Set to `false` to disable concurrent rendering. + * Otherwise `render` will default to concurrent rendering. */ - concurrentRoot?: boolean | undefined; + concurrentRoot?: boolean; createNodeMock?: (element: React.ReactElement) => unknown; unstable_validateStringsRenderedWithinText?: boolean;