Skip to content

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

Open
@rabave-poobalraj-zoomrx

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions