From 2771812902e426dee094d6f6c92751bf4c91e392 Mon Sep 17 00:00:00 2001 From: JiaLiPassion Date: Fri, 31 Jan 2020 13:42:34 +0900 Subject: [PATCH] feat: warning when jest already been patched by Zone --- src/zone-patch/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zone-patch/index.js b/src/zone-patch/index.js index d0549ae558..66a436375f 100644 --- a/src/zone-patch/index.js +++ b/src/zone-patch/index.js @@ -14,7 +14,8 @@ if (jest === undefined) { ); } if (jest['__zone_patch__'] === true) { - throw new Error("'jest' has already been patched with 'Zone'."); + console.warn("'jest' has already been patched with 'Zone'."); + return; } jest['__zone_patch__'] = true;