From 0a3d3b9c9520f4d8bc20e464c59e81ec6b270181 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Tue, 29 May 2018 20:12:57 -0700 Subject: [PATCH] Trim stacktrace --- packages/jest-jasmine2/src/error_on_private.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/jest-jasmine2/src/error_on_private.js b/packages/jest-jasmine2/src/error_on_private.js index 4502ffadbd4c..eef265001822 100644 --- a/packages/jest-jasmine2/src/error_on_private.js +++ b/packages/jest-jasmine2/src/error_on_private.js @@ -42,18 +42,20 @@ export function installErrorOnPrivate(global: Global): void { }; }); - const original = jasmine.DEFAULE_TIMEOUT_INTERVAL; + function set() { + throwAtFunction( + 'Illegal usage of `jasmine.DEFAULT_TIMEOUT_INTERVAL`, prefer `jest.setTimeout`.', + set, + ); + } + + const original = jasmine.DEFAULT_TIMEOUT_INTERVAL; // $FlowFixMe Flow seems to be confused about accessors and tries to enfoce having a `value` property. Object.defineProperty(jasmine, 'DEFAULT_TIMEOUT_INTERVAL', { configurable: true, enumerable: true, get: () => original, - set: () => { - throwAtFunction( - 'Illegal usage of `jasmine.DEFAULT_TIMEOUT_INTERVAL`, prefer `jest.setTimeout`.', - jasmine.set, - ); - }, + set, }); }