Last active
March 24, 2019 21:51
-
-
Save nwamugo/14a5a8e21beb481b86df93b7a5fb7ee5 to your computer and use it in GitHub Desktop.
Test demo for team Zinnia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import request from 'supertest'; | |
import chai from 'chai'; | |
import chaiAsPromised from 'chai-as-promised'; | |
import app from '../app'; | |
chai.use(chaiAsPromised); | |
const { expect } = chai; | |
const server = request(app); | |
const teamMembers = ['Osuh', 'Daniel', 'Edidiong', 'Opara', 'Ennim', 'Favour', 'Ugoji']; | |
describe('zinnia team', () => { | |
after(() => { | |
app.server.close(); | |
}); | |
context('team completeness', () => { | |
it('should be a team of 7', () => { | |
const size = teamMembers.length; | |
expect(teamMembers).to.not.be.null; | |
expect(size).to.equal(7); | |
)}; | |
)}; | |
)}; | |
So I don't leave here without a comment, you could replace the
let
for size withconst
since the variable is a constant. Eslint would probably flag it too. Great test suite though, well descriptive
Thank you for the feedback. I have now improved the code to reflect the suggestion you made. Improved!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So I don't leave here without a comment, you could replace the
let
for size withconst
since the variable is a constant. Eslint would probably flag it too. Great test suite though, well descriptive