Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jasmine test timeout is ignored #45

Open
1 of 2 tasks
provegard opened this issue Oct 3, 2019 · 1 comment
Open
1 of 2 tasks

Jasmine test timeout is ignored #45

provegard opened this issue Oct 3, 2019 · 1 comment

Comments

@provegard
Copy link

  • **I'm submitting a ... **

    • bug report
    • feature request
  • Do you want to request a feature or report a bug?

Report a bug

  • What is the current behavior?

When a Jasmine test has a test timeout like this:

it("should fail quickly", () => {
  return new Promise((res, rej) => {});
}, 1);

The resulting failure uses the default Jasmine timeout of 5000 ms instead of the specified timeout of 1 ms.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

The problem is that the wrapping function ignores any parameter after the test definition:

https://github.com/joeljeske/karma-parallel/blob/master/lib/karma-parallelizer.js#L111

I can try to prepare a repro if needed.

  • What is the expected behavior?

The custom timeout specified for the test should be used.

  • Please tell us about your environment:
  • version: 0.3.1
  • Browser: all
  • Language: all
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

The suggested fix is to pass along all arguments (extracted via arguments perhaps) to the wrapped function.

@Klaster1
Copy link

Had the same issue, you can work around it by setting the global timeout value:

    let timeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
    beforeEach(() => {
      jasmine.DEFAULT_TIMEOUT_INTERVAL = 30_000;
    });
    afterEach(() => {
      jasmine.DEFAULT_TIMEOUT_INTERVAL = timeout;
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants