anikethsaha/mern

Adding tests [ server tests ] for the project

开放

#21 创建于 2019年5月6日

 (11 条评论) (0 个反应) (0 位负责人)JavaScript (45 个派生)auto 404
good first issuehacktoberfesthelp wantedup-for-grabsv2

仓库指标

星标
 (99 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

The test library I am planning to use is jest. category of tests :

  • API tests
  • Snapshot tests

For now just two, please add more if works fine

Example of a test in chai

describe('/GET /', () => {
    it('it should GET all the books', (done) => {
      chai.request(server)
          .get('/')
          .end((err, res) => {
                res.should.have.status(200);
            done();
          });
    });
});

Thanks

贡献者指南