From 182555a4081f459cc6f9a270aef2b94e13dd19a1 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Mon, 26 Oct 2020 18:21:04 +0530 Subject: [PATCH] fix: tests --- e2e/__tests__/__snapshots__/failures.test.ts.snap | 12 +++++++++++- .../jest-jasmine2/src/expectationResultFactory.ts | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/e2e/__tests__/__snapshots__/failures.test.ts.snap b/e2e/__tests__/__snapshots__/failures.test.ts.snap index c085140acfa2..cd3010dd1840 100644 --- a/e2e/__tests__/__snapshots__/failures.test.ts.snap +++ b/e2e/__tests__/__snapshots__/failures.test.ts.snap @@ -188,9 +188,19 @@ FAIL __tests__/duringTests.test.js ● Object with stack prop thrown during test - 42 + thrown: Object { + "stack": 42, + } + 30 | }); + 31 | + > 32 | test('Object with stack prop thrown during test', () => { + | ^ + 33 | // eslint-disable-next-line no-throw-literal + 34 | throw {stack: 42}; + 35 | }); + at Object.test (__tests__/duringTests.test.js:32:1) ● Error during test diff --git a/packages/jest-jasmine2/src/expectationResultFactory.ts b/packages/jest-jasmine2/src/expectationResultFactory.ts index d4533fdf3dcc..035d9a6a52ed 100644 --- a/packages/jest-jasmine2/src/expectationResultFactory.ts +++ b/packages/jest-jasmine2/src/expectationResultFactory.ts @@ -43,7 +43,7 @@ function stackFormatter( } if (options.error) { - if (options.error.stack) { + if ( typeof options.error.stack === 'string') { return options.error.stack; }