Skip to content

Commit 8222651

Browse files
arthurdennerCompuIves
authored andcommitted
fix(tests): update error-polyfill to fix unexpected frame error (codesandbox#3091)
* fix(deps): update error-polyfill dependency to get rid of unexpected frame error * fix(jest-lite): check length of mappedErrors before destructuring it
1 parent 068449a commit 8222651

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

packages/app/src/sandbox/eval/tests/jest-lite.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,9 @@ export default class TestRunner {
421421

422422
if (test.errors) {
423423
test.errors.forEach(err => {
424-
if (err.mappedErrors) {
424+
if (err.mappedErrors && err.mappedErrors.length) {
425425
const { mappedErrors } = err;
426-
const mappedError = mappedErrors[0];
426+
const [mappedError] = mappedErrors;
427427

428428
dispatch(
429429
actions.error.show(err.name || 'Jest Error', err.message, {

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"color": "0.11.4",
5353
"date-fns": "^2.0.0",
5454
"dot-object": "1.9.0",
55-
"error-polyfill": "^0.1.1",
55+
"error-polyfill": "^0.1.2",
5656
"humps": "CompuIves/humps",
5757
"image-extensions": "^1.1.0",
5858
"immer": "^3.2.0",

yarn.lock

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10262,9 +10262,10 @@ error-ex@^1.2.0, error-ex@^1.3.1:
1026210262
dependencies:
1026310263
is-arrayish "^0.2.1"
1026410264

10265-
error-polyfill@^0.1.1:
10266-
version "0.1.1"
10267-
resolved "https://registry.yarnpkg.com/error-polyfill/-/error-polyfill-0.1.1.tgz#276654aad92ff2615582a323066173cc18da1eaf"
10265+
error-polyfill@^0.1.2:
10266+
version "0.1.2"
10267+
resolved "https://registry.yarnpkg.com/error-polyfill/-/error-polyfill-0.1.2.tgz#05b27de7d126cbc9d42a96f45faab28a98a0b28b"
10268+
integrity sha512-8uhnXlJuhFkmIfhw2tAHtWQGpXcw5rrc0dhuY3bhn8tBHvh6l0oL9VJvR2suqx9eltglKKhVPv8luPQy+UxLTA==
1026810269
dependencies:
1026910270
capability "^0.2.5"
1027010271
o3 "^1.0.3"

0 commit comments

Comments
 (0)