如何使用 chai 或 mocha 检查图像是否存在?
How to check whether image exist using chai or mocha?
使用Chai 或mocha,如何查看图像是否存在。例如,https://upload.wikimedia.org/wikipedia/commons/5/51/Google.png
可能chai http插件:
it('should check image', function(done) {
chai.request('https://upload.wikimedia.org')
.get('/wikipedia/commons/5/51/Google.png')
.end(function(err, res) {
expect(res).to.have.status(200);
done();
});
});
使用Chai 或mocha,如何查看图像是否存在。例如,https://upload.wikimedia.org/wikipedia/commons/5/51/Google.png
可能chai http插件:
it('should check image', function(done) {
chai.request('https://upload.wikimedia.org')
.get('/wikipedia/commons/5/51/Google.png')
.end(function(err, res) {
expect(res).to.have.status(200);
done();
});
});