From fcc5b0a1f2bf04e63f12ba2ef6539cd51fe86e6d Mon Sep 17 00:00:00 2001 From: Brian Donovan <1938+eventualbuddha@users.noreply.github.com> Date: Fri, 16 Aug 2019 13:57:47 -0700 Subject: [PATCH 1/3] fix: spread console error args when proxying Without this the proxied errors are logged as an array, which is not very helpful. --- src/act-compat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/act-compat.js b/src/act-compat.js index e16b135f..ef0ee2e7 100644 --- a/src/act-compat.js +++ b/src/act-compat.js @@ -42,7 +42,7 @@ function asyncAct(cb) { ) { // no-op } else { - originalConsoleError.call(console, args) + originalConsoleError.call(console, ...args) } } let cbReturn, result From f7b8e5df6bb42a26939fadaba94ea0eb7821e3bd Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Fri, 16 Aug 2019 15:03:14 -0600 Subject: [PATCH 2/3] Update act-compat.js --- src/act-compat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/act-compat.js b/src/act-compat.js index ef0ee2e7..dd5f1d96 100644 --- a/src/act-compat.js +++ b/src/act-compat.js @@ -42,7 +42,7 @@ function asyncAct(cb) { ) { // no-op } else { - originalConsoleError.call(console, ...args) + originalConsoleError.apply(console, args) } } let cbReturn, result From 366c177fd555867466ec1b73b4901330f7109845 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Fri, 16 Aug 2019 15:04:50 -0600 Subject: [PATCH 3/3] Update old-act.js --- src/__tests__/old-act.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/__tests__/old-act.js b/src/__tests__/old-act.js index 0098ed08..fcd531b4 100644 --- a/src/__tests__/old-act.js +++ b/src/__tests__/old-act.js @@ -34,9 +34,7 @@ test('async act works even when the act is an old one', async () => { expect(console.error.mock.calls).toMatchInlineSnapshot(` Array [ Array [ - Array [ - "sigil", - ], + "sigil", ], Array [ "It looks like you're using a version of react-dom that supports the \\"act\\" function, but not an awaitable version of \\"act\\" which you will need. Please upgrade to at least react-dom@16.9.0 to remove this warning.",