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

No files found #132

Open
amiteshCoder opened this issue Nov 9, 2018 · 0 comments
Open

No files found #132

amiteshCoder opened this issue Nov 9, 2018 · 0 comments

Comments

@amiteshCoder
Copy link

amiteshCoder commented Nov 9, 2018

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
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