I am running test using, I want to test the response header against the property Content-Type: application/pdf .This api call returns pdf file. Here is what I tried
**spec file **
const chaiHTTP=require('chai-http');
chai.use(chaiHTTP);
const app=require('../../app');
it.only('should test pdf',function(done){
const log=chai.request(app).get('/api/getPDF').set(req);
console.log(log.header);
expect(log.header.content-type).to.be.eql(' application/pdf');//fails
done();
})
Aucun commentaire:
Enregistrer un commentaire