Chai Mocha testing works locally but does not work on Jenkins
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
add a comment |
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
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
add a comment |
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
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
jenkins mocha chai
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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
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
|
show 1 more comment
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
|
show 1 more comment
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
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
|
show 1 more comment
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
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
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
|
show 1 more comment
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
|
show 1 more comment
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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