Full code here
for (var i = 0; i < allFeeds.length; i++) {
asyncLoad(i);
let j = i + 1;
}
function asyncLoad(i) {
describe('feed', function() {
let priorFeed;
let latterFeed;
beforeEach(function(done) {
loadFeed(i, function(){
priorFeed = $('.header-title').text();
loadFeed(j, function(){
latterFeed = $('.header-title').text();
});
});
});
it('changes title and content on load', function() {
expect(priorFeed).not.toBe(latterFeed);
});
});
}
});
Am using Jasmine testing, for this test, the title should not equal the prior title. But am either getting errors for "Async callback was not invoked within timeout" or url not defined. AsyncLoad parameter is i, which is then used in loadFeed, loadFeed i is then compared to loadFeed i + 1, and they should not be the same, but this isn't working.
How else can I structure so that it isn't make j go over the number of feeds, or check this feed vs last feed?
Aucun commentaire:
Enregistrer un commentaire