-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
For the 404 test in the 'Testing the Server' section, I think the .get needs to be called before .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.
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels