Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to send multiple json in post request using supertest #303

Open
rabave-poobalraj-zoomrx opened this issue Jul 8, 2022 · 0 comments
Open

Comments

@rabave-poobalraj-zoomrx
Copy link

it('post the user', () => {
const value = [{
text: 'Todo1'
},
{
text: 'Todo2'
}];
return request(app)
.post('/api/todos/')
.send({value})
.then(res => {
res.should.have.status(201);
});
});

Got Error:

1 failing

  1. The server
    on GET /api/todos requests
    post the user:

    AssertionError: expected { Object (_events, _eventsCount, ...) } to have status code 201 but got 400

    • expected - actual
      -400
      +201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant