From 63c27e243e6c429b44a76daf8886be5a612aa5be Mon Sep 17 00:00:00 2001 From: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> Date: Sat, 10 Dec 2022 17:36:30 +0100 Subject: [PATCH] feat: deprecate detectChanges in favor of detectChangesOnRender (#340) --- projects/testing-library/src/lib/models.ts | 17 +++++++++++++++++ .../testing-library/src/lib/testing-library.ts | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/projects/testing-library/src/lib/models.ts b/projects/testing-library/src/lib/models.ts index 1f33192..0933952 100644 --- a/projects/testing-library/src/lib/models.ts +++ b/projects/testing-library/src/lib/models.ts @@ -78,8 +78,25 @@ export interface RenderComponentOptions( ): Promise> { const { dom: domConfig, ...globalConfig } = getConfig(); const { - detectChanges: detectChangesOnRender = true, + detectChanges: detectChangesDeprecated = true, + detectChangesOnRender: detectChangesOnRenderInput, declarations = [], imports = [], providers = [], @@ -63,6 +64,8 @@ export async function render( defaultImports = [], } = { ...globalConfig, ...renderOptions }; + const detectChangesOnRender = + detectChangesOnRenderInput === undefined ? detectChangesDeprecated : detectChangesOnRenderInput; dtlConfigure({ eventWrapper: (cb) => { const result = cb();