Skip to content

Commit

Permalink
Trim stacktrace
Browse files Browse the repository at this point in the history
  • Loading branch information
captbaritone committed May 30, 2018
1 parent b852e5d commit 0a3d3b9
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/jest-jasmine2/src/error_on_private.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}

Expand Down

0 comments on commit 0a3d3b9

Please sign in to comment.