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 e5c86c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ exports[`DEFAULT_TIMEOUT_INTERVAL.test.js errors in erroOnDeprecated mode 1`] =
12 | });
13 |
at packages/jest-jasmine2/build/error_on_private.js:69:11
at __tests__/DEFAULT_TIMEOUT_INTERVAL.test.js:10:3
"
Expand Down
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 e5c86c4

Please sign in to comment.