Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(function(){
superagent.cache.flush();
});
beforeEach(function(){
superagent.cache.flush();
});
beforeEach(function(){
superagent.cache.flush();
});
.end(function (err, response, key) {
superagent.cache.get(key, function (err, response){
expect(response).toBe(null);
superagent
.get('localhost:3001/one')
.cacheWhenEmpty(false)
.prune(prune)
.end(function (err, response, key) {
superagent.cache.get(key, function (err, response){
expect(response).toBe(200);
done();
});
}
);
});
}
);
beforeEach(function(){
superagent.cache.flush();
});
setTimeout(function(){
superagent.cache.get(key, function (err, response){
expect(response.body.pruneQuery).toBe('true');
expect(response.body.otherParams).toBe('false');
expect(key.indexOf('pruneQuery')).toBe(-1);
expect(key.indexOf('otherParams')).toBeGreaterThan(-1);
done();
});
}, 1500);
}
beforeEach(function(){
superagent.cache.flush();
});
.end(function (err, response, key){
expect(response.body.key).toBe('post');
superagent.cache.get(key, function (err, response) {
expect(response).toBe(null);
checkBrowserStorage(key, false, done);
});
}
);
.end(function (err, response, key){
superagent.cache.get(key, function (err, response) {
expect(response).toNotBe(null);
expect(response.body.key).toBe('one');
setTimeout(function(){
superagent
.get('localhost:3004/one')
.end(function (err, response, key){
superagent.cache.get(key, function (err, response) {
expect(response).toNotBe(null);
expect(response.body.key).toBe('one');
done();
});
}
);
}, 1000);
});
}
beforeEach(function(){
superagent.cache.flush();
});