我有两个测试用例,即它(“应该通过......”)..和它(“应该失败......”)..,当我测试它时,它给出了超过 2000 毫秒的超时错误。
describe("flickrphotoSearch", function () {
it("should pass with correct inputs", function (done) {
flickrApplication.flickrPhotoSearch("hello", "flickr_user_Key", 1, handleData);
function handleData(photoUrl, done) {
this.setTimeout(1500);
assert.isString(photoUrl.toString(), 'not a string');
setTimeout(done, 1000);
};
});
it("should fail with wrong key", function (callingDone) {
flickrApplication.flickrPhotoSearch("hello", "wrong key", 1, handleData);
function handleData(photoUrl, done) {
this.setTimeout(1500);
assert.equal(photoUrl.stat, "ok", photoUrl.message);
setTimeout(done, 1000);
};
});
});
对于第一个测试,我遇到超时错误,但第二个运行良好。请告诉我哪里错了。