-
Notifications
You must be signed in to change notification settings - Fork 45
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 timeout somehow used in Jest tests? #896
Comments
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; and making it module.exports = function(wallaby) {
return {
...
setup: function (w) {
...
w.testFramework.configure({
setupTestFrameworkScriptFile: '<rootDir>/jestSetup.js'
});
}
};
}; |
5000 works well as a global config, if you want to change the timeout for a specific test, please do this
|
@sudhanshuraheja does this work for both sync and async tests? I could not use timeout for potentially long-running sync jobs – these tests never caused a timeout: test("sync test", () => {
const result = slowSyncFunction();
expect(result).toEqual(42);
}, 10) This works though: test("async test", async () => {
const result = await slowAsyncFunction();
expect(result).toEqual(42);
}, 10) If timeouts for sync stuff are not supported by design, how could the efficiency of sync code tested in jest then? |
@kachkaev I don't think Jest (or any test runners, except for Wallaby.js) can detect timeouts in long-running sync tests. |
I have two Wallaby configs, one for Jasmine and one for Jest.
wallabyJest.js
:When I run a test using that config, if it fails by a timeout I get the following message in the console:
I can't see where to change the default timeout, nor why it's taking a jasmine environment var.
If I change that var in the test itself, for example bu putting
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10
inbeforeEach()
, it uses the changed value, but I can't find a way t set it globally.Am I missing something?
The text was updated successfully, but these errors were encountered: