The exact error message is :
Timeout - Async callback was not invoked within timeout
specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
At first, only Node.js 4 version build was failing.
After adding more test, all Node.js version builds were broken (4, 6, 7, 8).
I use Travis CI for my test and Jest (for a Yeoman generator).
You can check out the job log error message if you want.
Tried:
Set a new timeout value.
let originalTimeout;
describe('generator-cozen-angular:sub-task', () => {
beforeEach(() => {
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
});
afterEach(() => {
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
});
it('do some stuff');
});
If you have an idea or a solution, you will save my day.
Thanks.
I just found out the solution by reading the Jest documentation.
Since the errors are only in Travis CI, I assumed that their servers were just slower than my local one.
With that information, running :
jest --runInBand
Fixed my problems.
EDIT 1:
I encountered the problem one more time by addind more tests.
The other solution found is to change the Jest timeout.
jest.setTimeout(10000);
Where 10000 is milliseconds.
To add on top of the file just before the describe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With