Skip to content

Commit

Permalink
Add new Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oscargarcia-tines committed Nov 28, 2017
1 parent 1a0d26d commit 6ab6a24
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ describe('Stats api', () => {
});
});

it('should be json file', (done) => {
chai.request(server)
.get('/api/WEC/2017/SPA')
.end((err, res) => {
res.should.be.json; // passes test
res.body.should.be.a('array');
done();
});
});

it('Included IMSA 2017 VIRGINIA', (done) => {
chai.request(server)
.get('/api/IMSA/2017/VIRGINIA')
Expand Down Expand Up @@ -130,6 +140,31 @@ describe('Stats api', () => {
});
});

it('should be json file', (done) => {
chai.request(server)
.get('/api/getevents')
.end((err, res) => {
res.should.be.json; // passes test
res.body.should.be.a('array');
done();
});
});

it('should have BAHRAIN 2017 WEC', (done) => {
chai.request(server)
.get('/api/getevents')
.end((err, res) => {
res.body[38].should.have.property('series');
res.body[38].should.have.property('year');
res.body[38].should.have.property('event');
res.body[38].series.should.equal('WEC');
res.body[38].year.should.equal('2017');
res.body[38].event.should.equal('BAHRAIN');
done();
});
});


});

describe("Seconds Function", () => {
Expand Down

0 comments on commit 6ab6a24

Please sign in to comment.