小编Sai*_*ama的帖子

TypeError:无法读取未定义的supertest的属性"address"

我需要一些帮助来解决我在nodejs代码上测试的问题.我正在使用摩卡和超级.我对supertest中的实现感到困惑.我不知道解决了.我正在尝试自动下载文件.

`describe('GET /entry/:entryId/file/:id/download', function(){
 it('should pass download function', function(done){
   this.timeout(15000);
   request(app.webServer)
  .get('/entry/543CGsdadtrE/file/wDRDasdDASAS/download')
  .set('Authorization', 'Bearer eyJ0eXAiOiJKV1QiLCJhbGco')
  .expect(200)
  .end(function(err, res){
  if (err) return done(err);
  console.log(err, res);
  done();
 });
});
});
Run Code Online (Sandbox Code Playgroud)

mocha.js node.js supertest

12
推荐指数
2
解决办法
1万
查看次数

标签 统计

mocha.js ×1

node.js ×1

supertest ×1