Skip to content

No files found #132

Description

@amiteshCoder

I am trying to upload a file using the chakram. But while doing so I am getting No files found error.

Here is the configuration of my test:
```
const fs = require('fs');
const chakram = require('chakram'),
expect = chakram.expect;
path = require("path");

describe("Upload Image", () => {
it("Checks endpoint for status 200", () => {

    // Arrange
    const imagesService = new ImagesService(chakram);
    let file = path.resolve('./Users/amiteshshukla/Desktop/screenshots/', 'Screen_Shot_2018-07-04 at 12.00.54.png');
    let formData = {

        "formData": {
            "file": fs.createReadStream(file),
        },
        "Content-Type": "image/png",
        "Content-Disposition": "form-data"
    };

    // Act
    const response = imagesService.hitsUploadImage(formData);
    response.then((res) => {
        console.log(res);
    });

    // Assert
    return expect(response).to.have.status(200);
});

});


**Output**:
body: { errors: [ 'No files found' ], response: 'failed' },

Can anyone help me in solving this . Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions