Chai Mocha testing works locally but does not work on Jenkins












0















I get the following error



Error: timeout of 10000ms exceeded. Ensure the done() callback is being called in this test.


Looking forward to hear from you guys, and thanks in advance!



Here is my code! Below is my test case that I am executing on Jenkins



describe('/candidateID route', () => {
it('gets the candidate info', function (done) {
chai.request(server)
.get('/candidateInfo/' + candidateId + '/' + reqNum)
.set('jwt', vcapServices.JWT_TOKEN)
.end(function (err, res) {
if(err) {
done(err);
return;
}
expect(res).to.have.status(200);
res.body.should.be.a('array');
res.body.length.should.be.eql(1);
expect(res.body[0]).to.have.a.property('applicantId');
expect(res.body[0]).to.have.a.property('requistionNumber');
expect(res.body[0]).to.have.a.property('firstName');
expect(res.body[0]).to.have.a.property('lastName');
expect(res.body[0]).to.have.a.property('emailAddress');
expect(res.body[0]).to.have.a.property('storeNumber');
expect(res.body[0]).to.have.a.property('locationCountry');
expect(res.body[0]).to.have.a.property('locationStateCode');
expect(res.body[0]).to.have.a.property('firstAddress');
expect(res.body[0]).to.have.a.property('secondAddress');
expect(res.body[0]).to.have.a.property('thirdAddress');
expect(res.body[0]).to.have.a.property('cityName');
expect(res.body[0]).to.have.a.property('state');
expect(res.body[0]).to.have.a.property('zipCode');
done();
});
});
});









share|improve this question




















  • 1





    Welcome to SO, please post an extract of your code that is not working to make it easier for members to possibly reproduce your issue and help you.

    – Ivan Gabriele
    Nov 20 '18 at 20:50
















0















I get the following error



Error: timeout of 10000ms exceeded. Ensure the done() callback is being called in this test.


Looking forward to hear from you guys, and thanks in advance!



Here is my code! Below is my test case that I am executing on Jenkins



describe('/candidateID route', () => {
it('gets the candidate info', function (done) {
chai.request(server)
.get('/candidateInfo/' + candidateId + '/' + reqNum)
.set('jwt', vcapServices.JWT_TOKEN)
.end(function (err, res) {
if(err) {
done(err);
return;
}
expect(res).to.have.status(200);
res.body.should.be.a('array');
res.body.length.should.be.eql(1);
expect(res.body[0]).to.have.a.property('applicantId');
expect(res.body[0]).to.have.a.property('requistionNumber');
expect(res.body[0]).to.have.a.property('firstName');
expect(res.body[0]).to.have.a.property('lastName');
expect(res.body[0]).to.have.a.property('emailAddress');
expect(res.body[0]).to.have.a.property('storeNumber');
expect(res.body[0]).to.have.a.property('locationCountry');
expect(res.body[0]).to.have.a.property('locationStateCode');
expect(res.body[0]).to.have.a.property('firstAddress');
expect(res.body[0]).to.have.a.property('secondAddress');
expect(res.body[0]).to.have.a.property('thirdAddress');
expect(res.body[0]).to.have.a.property('cityName');
expect(res.body[0]).to.have.a.property('state');
expect(res.body[0]).to.have.a.property('zipCode');
done();
});
});
});









share|improve this question




















  • 1





    Welcome to SO, please post an extract of your code that is not working to make it easier for members to possibly reproduce your issue and help you.

    – Ivan Gabriele
    Nov 20 '18 at 20:50














0












0








0








I get the following error



Error: timeout of 10000ms exceeded. Ensure the done() callback is being called in this test.


Looking forward to hear from you guys, and thanks in advance!



Here is my code! Below is my test case that I am executing on Jenkins



describe('/candidateID route', () => {
it('gets the candidate info', function (done) {
chai.request(server)
.get('/candidateInfo/' + candidateId + '/' + reqNum)
.set('jwt', vcapServices.JWT_TOKEN)
.end(function (err, res) {
if(err) {
done(err);
return;
}
expect(res).to.have.status(200);
res.body.should.be.a('array');
res.body.length.should.be.eql(1);
expect(res.body[0]).to.have.a.property('applicantId');
expect(res.body[0]).to.have.a.property('requistionNumber');
expect(res.body[0]).to.have.a.property('firstName');
expect(res.body[0]).to.have.a.property('lastName');
expect(res.body[0]).to.have.a.property('emailAddress');
expect(res.body[0]).to.have.a.property('storeNumber');
expect(res.body[0]).to.have.a.property('locationCountry');
expect(res.body[0]).to.have.a.property('locationStateCode');
expect(res.body[0]).to.have.a.property('firstAddress');
expect(res.body[0]).to.have.a.property('secondAddress');
expect(res.body[0]).to.have.a.property('thirdAddress');
expect(res.body[0]).to.have.a.property('cityName');
expect(res.body[0]).to.have.a.property('state');
expect(res.body[0]).to.have.a.property('zipCode');
done();
});
});
});









share|improve this question
















I get the following error



Error: timeout of 10000ms exceeded. Ensure the done() callback is being called in this test.


Looking forward to hear from you guys, and thanks in advance!



Here is my code! Below is my test case that I am executing on Jenkins



describe('/candidateID route', () => {
it('gets the candidate info', function (done) {
chai.request(server)
.get('/candidateInfo/' + candidateId + '/' + reqNum)
.set('jwt', vcapServices.JWT_TOKEN)
.end(function (err, res) {
if(err) {
done(err);
return;
}
expect(res).to.have.status(200);
res.body.should.be.a('array');
res.body.length.should.be.eql(1);
expect(res.body[0]).to.have.a.property('applicantId');
expect(res.body[0]).to.have.a.property('requistionNumber');
expect(res.body[0]).to.have.a.property('firstName');
expect(res.body[0]).to.have.a.property('lastName');
expect(res.body[0]).to.have.a.property('emailAddress');
expect(res.body[0]).to.have.a.property('storeNumber');
expect(res.body[0]).to.have.a.property('locationCountry');
expect(res.body[0]).to.have.a.property('locationStateCode');
expect(res.body[0]).to.have.a.property('firstAddress');
expect(res.body[0]).to.have.a.property('secondAddress');
expect(res.body[0]).to.have.a.property('thirdAddress');
expect(res.body[0]).to.have.a.property('cityName');
expect(res.body[0]).to.have.a.property('state');
expect(res.body[0]).to.have.a.property('zipCode');
done();
});
});
});






jenkins mocha chai






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 6:04







Mayur

















asked Nov 20 '18 at 19:28









MayurMayur

13




13








  • 1





    Welcome to SO, please post an extract of your code that is not working to make it easier for members to possibly reproduce your issue and help you.

    – Ivan Gabriele
    Nov 20 '18 at 20:50














  • 1





    Welcome to SO, please post an extract of your code that is not working to make it easier for members to possibly reproduce your issue and help you.

    – Ivan Gabriele
    Nov 20 '18 at 20:50








1




1





Welcome to SO, please post an extract of your code that is not working to make it easier for members to possibly reproduce your issue and help you.

– Ivan Gabriele
Nov 20 '18 at 20:50





Welcome to SO, please post an extract of your code that is not working to make it easier for members to possibly reproduce your issue and help you.

– Ivan Gabriele
Nov 20 '18 at 20:50












1 Answer
1






active

oldest

votes


















0














I was facing similar problem with CircleCI. I updated the mocha.opts file with timeout parameter to resolve the issue. Not the most elegant solution but works.






--timeout 99999999 








share|improve this answer
























  • Also I think --no-timeouts will work.

    – shmit
    Nov 20 '18 at 21:33











  • Timeout did not work for me actually.

    – Mayur
    Nov 21 '18 at 6:13











  • Hmm. Maybe you can try defining timeout for the test at the 'describe' or 'it' level and see if it helps by using this.timeout(10000);. The 'it' level timeout setting should override any other settings that may be getting enforced by Jenkins.

    – shmit
    Nov 21 '18 at 16:39











  • Thanks for quick reply Shmit! I tried using this.timeout(10000), but it did not work for me as well

    – Mayur
    Nov 26 '18 at 14:50











  • I would really be interested in knowing the solution. Please do post it when you find it.

    – shmit
    Nov 26 '18 at 16:50











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53400198%2fchai-mocha-testing-works-locally-but-does-not-work-on-jenkins%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I was facing similar problem with CircleCI. I updated the mocha.opts file with timeout parameter to resolve the issue. Not the most elegant solution but works.






--timeout 99999999 








share|improve this answer
























  • Also I think --no-timeouts will work.

    – shmit
    Nov 20 '18 at 21:33











  • Timeout did not work for me actually.

    – Mayur
    Nov 21 '18 at 6:13











  • Hmm. Maybe you can try defining timeout for the test at the 'describe' or 'it' level and see if it helps by using this.timeout(10000);. The 'it' level timeout setting should override any other settings that may be getting enforced by Jenkins.

    – shmit
    Nov 21 '18 at 16:39











  • Thanks for quick reply Shmit! I tried using this.timeout(10000), but it did not work for me as well

    – Mayur
    Nov 26 '18 at 14:50











  • I would really be interested in knowing the solution. Please do post it when you find it.

    – shmit
    Nov 26 '18 at 16:50
















0














I was facing similar problem with CircleCI. I updated the mocha.opts file with timeout parameter to resolve the issue. Not the most elegant solution but works.






--timeout 99999999 








share|improve this answer
























  • Also I think --no-timeouts will work.

    – shmit
    Nov 20 '18 at 21:33











  • Timeout did not work for me actually.

    – Mayur
    Nov 21 '18 at 6:13











  • Hmm. Maybe you can try defining timeout for the test at the 'describe' or 'it' level and see if it helps by using this.timeout(10000);. The 'it' level timeout setting should override any other settings that may be getting enforced by Jenkins.

    – shmit
    Nov 21 '18 at 16:39











  • Thanks for quick reply Shmit! I tried using this.timeout(10000), but it did not work for me as well

    – Mayur
    Nov 26 '18 at 14:50











  • I would really be interested in knowing the solution. Please do post it when you find it.

    – shmit
    Nov 26 '18 at 16:50














0












0








0







I was facing similar problem with CircleCI. I updated the mocha.opts file with timeout parameter to resolve the issue. Not the most elegant solution but works.






--timeout 99999999 








share|improve this answer













I was facing similar problem with CircleCI. I updated the mocha.opts file with timeout parameter to resolve the issue. Not the most elegant solution but works.






--timeout 99999999 








--timeout 99999999 





--timeout 99999999 






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 20 '18 at 21:31









shmitshmit

581311




581311













  • Also I think --no-timeouts will work.

    – shmit
    Nov 20 '18 at 21:33











  • Timeout did not work for me actually.

    – Mayur
    Nov 21 '18 at 6:13











  • Hmm. Maybe you can try defining timeout for the test at the 'describe' or 'it' level and see if it helps by using this.timeout(10000);. The 'it' level timeout setting should override any other settings that may be getting enforced by Jenkins.

    – shmit
    Nov 21 '18 at 16:39











  • Thanks for quick reply Shmit! I tried using this.timeout(10000), but it did not work for me as well

    – Mayur
    Nov 26 '18 at 14:50











  • I would really be interested in knowing the solution. Please do post it when you find it.

    – shmit
    Nov 26 '18 at 16:50



















  • Also I think --no-timeouts will work.

    – shmit
    Nov 20 '18 at 21:33











  • Timeout did not work for me actually.

    – Mayur
    Nov 21 '18 at 6:13











  • Hmm. Maybe you can try defining timeout for the test at the 'describe' or 'it' level and see if it helps by using this.timeout(10000);. The 'it' level timeout setting should override any other settings that may be getting enforced by Jenkins.

    – shmit
    Nov 21 '18 at 16:39











  • Thanks for quick reply Shmit! I tried using this.timeout(10000), but it did not work for me as well

    – Mayur
    Nov 26 '18 at 14:50











  • I would really be interested in knowing the solution. Please do post it when you find it.

    – shmit
    Nov 26 '18 at 16:50

















Also I think --no-timeouts will work.

– shmit
Nov 20 '18 at 21:33





Also I think --no-timeouts will work.

– shmit
Nov 20 '18 at 21:33













Timeout did not work for me actually.

– Mayur
Nov 21 '18 at 6:13





Timeout did not work for me actually.

– Mayur
Nov 21 '18 at 6:13













Hmm. Maybe you can try defining timeout for the test at the 'describe' or 'it' level and see if it helps by using this.timeout(10000);. The 'it' level timeout setting should override any other settings that may be getting enforced by Jenkins.

– shmit
Nov 21 '18 at 16:39





Hmm. Maybe you can try defining timeout for the test at the 'describe' or 'it' level and see if it helps by using this.timeout(10000);. The 'it' level timeout setting should override any other settings that may be getting enforced by Jenkins.

– shmit
Nov 21 '18 at 16:39













Thanks for quick reply Shmit! I tried using this.timeout(10000), but it did not work for me as well

– Mayur
Nov 26 '18 at 14:50





Thanks for quick reply Shmit! I tried using this.timeout(10000), but it did not work for me as well

– Mayur
Nov 26 '18 at 14:50













I would really be interested in knowing the solution. Please do post it when you find it.

– shmit
Nov 26 '18 at 16:50





I would really be interested in knowing the solution. Please do post it when you find it.

– shmit
Nov 26 '18 at 16:50




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53400198%2fchai-mocha-testing-works-locally-but-does-not-work-on-jenkins%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents