Open asbates opened 4 years ago
For the 404 test in the 'Testing the Server' section, I think the .get needs to be called before .expect.
.get
.expect
The test is
it('should 404 for other pages', (done) => { request(server) .expect(404) // expect first .get('/other') .end((err, res) => { assert(res.text.includes('ERROR'), 'Has expected error message') done() }) })
When I runs the tests with this, I get TypeError: request(...).expect is not a function.
TypeError: request(...).expect is not a function
I think it should be
it('should 404 for other pages', (done) => { request(server) .get('/other') // get first .expect(404) // ... }) })
where the get request is made before we can check the result is as expected. Doing this results in a passing test for me.
Happy to submit a PR if you all agree with my assessment.
For the 404 test in the 'Testing the Server' section, I think the
.get
needs to be called before.expect
.The test is
When I runs the tests with this, I get
TypeError: request(...).expect is not a function
.I think it should be
where the get request is made before we can check the result is as expected. Doing this results in a passing test for me.
Happy to submit a PR if you all agree with my assessment.