संबंधित: Can't set timeout for jasmineमेरा जैस्मीन परीक्षण DEFAULT_TIMEOUT_INTERVAL से पहले क्यों समाप्त हो रहा है?
Jasmine 2.4.1
मेरा परीक्षण समय समाप्ति के कारण एक विफलता की रिपोर्ट है, भले ही टाइमआउट मान सूचना समय से अधिक होना प्रतीत होता है।
मैं यह कर रहा हूँ:
describe('tests content controller', function(){
beforeAll(function(done) {
jasmine.DEFAULT_TIMEOUT_INTERVAL= 120000;
//...
})
fit('/content GET should return 200',function(done){
request(app)
.get('/content')
.set('Authorization', "bearer " + requestor.token)
.set('Accept', 'application/json')
.expect(200)
.end(function (err, res) {
console.log('timeout',jasmine.DEFAULT_TIMEOUT_INTERVAL); //prints 120000
if (err) done.fail(err);
expect(res.statusCode).toBe(200);
done();
})
});
फिर इस परीक्षण, विफल रहता है के साथ:
1) tests content controller /content GET should return 200
Message:
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
Stack:
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
Finished in 106.449 seconds
106,449 सेकंड से भी कम समय 120 सेकंड है, जो कि मेरी टाइमआउट मान पर सेट किया जाना प्रतीत होता है है ।
तो यह परीक्षण क्यों विफल रहा है?
'getEnv() 'विधि करने वाले @engineer' console.log' का कारण बनता है जो टाइमआउट को हिट नहीं करता है। 'पहले से' से पहले 'पहले' से बदलना मदद नहीं करता था – Houseman