Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
update message and provide current timeout value
  • Loading branch information
dylang committed Nov 30, 2017
commit c8362c917e74dfe0033a4ee91fe00c93fc1b7bf5
2 changes: 1 addition & 1 deletion packages/jest-jasmine2/src/__tests__/queue_runner.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('queueRunner', () => {
// i.e. the `message` of the error passed to `onException`.
expect(onException.mock.calls[0][0].message).toEqual(
'Timeout - Async callback was not invoked within timeout specified ' +
'by jasmine.DEFAULT_TIMEOUT_INTERVAL.',
'by jest.setTimeout: 0ms.',
);
expect(fnTwo).toHaveBeenCalled();
});
Expand Down
8 changes: 5 additions & 3 deletions packages/jest-jasmine2/src/queue_runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,17 @@ export default function queueRunner(options: Options) {
if (!timeout) {
return promise;
}
const timeoutMs: number = timeout();
return pTimeout(
promise,
timeout(),
timeoutMs,
options.clearTimeout,
options.setTimeout,
() => {
const error = new Error(
'Timeout - Async callback was not invoked within timeout specified ' +
'by jasmine.DEFAULT_TIMEOUT_INTERVAL.',
'Timeout - Async callback was not invoked within timeout specified by jest.setTimeout: ' +
timeoutMs +
'ms.',
);
options.onException(error);
},
Expand Down