abramenal / cypress-file-upload

File upload testing made easy
https://npm.im/cypress-file-upload
MIT License
496 stars 89 forks source link

Fix fileContent type #326

Closed yoavbls closed 2 years ago

yoavbls commented 2 years ago

Checklist:

Summary of changes

When file extension is json, file content needs to be an object and not Blob.
You can see it there:
https://github.com/abramenal/cypress-file-upload/blob/45ae45cc97c4833e594285c9631208246e27413c/lib/file/getFileBlobAsync.js#L27

So I changed the contentFile type to be a Blob or object

abramenal commented 2 years ago

Hi @yoavbls Thanks for submitting the PR!

I think I'm missing the use case here – how exactly a fixture you're providing is an object? Is it some dynamically generated fixture you're creating right in test? Or it's just what cy.readFile parses for you?

abramenal commented 2 years ago

@all-contributors add @yoavbls for code

allcontributors[bot] commented 2 years ago

@abramenal

I've put up a pull request to add @yoavbls! :tada: