Skip to content
This repository has been archived by the owner on Dec 30, 2021. It is now read-only.

Modernization #105

Merged
merged 10 commits into from
Mar 4, 2021
Merged

Modernization #105

merged 10 commits into from
Mar 4, 2021

Conversation

kaimallea
Copy link
Owner

Some minor modernization tweaks. Most important change here is the mocking that makes uploadFile testable

cc @KenEucker if you still have an interest (no pressure)

mockfs({
'/home/user/meme.jpg': Buffer.from([8, 6, 7, 5, 3, 0, 9]),
'/home/user/lol.jpg': Buffer.from([9, 0, 3, 5, 7, 6, 8]),
});
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mock file system available in all tests. any fs.* method will think these are real. key == file, value == file contents

};
return res(ctx.json(response));
}),
];
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mock response handler used for uploadFile test. As easy as adding more handlers to mock responses for other methods.

BREAKING CHANGE: uploadFile no longer accepts a glob pattern. It now
accepts either a single image path or an array of image paths. If you
must glob, do it yourself and then pass in the array. This removes an
unnecessary complexity from the most important method.
@kaimallea kaimallea changed the title Develop Modernization Mar 4, 2021
Copy link
Collaborator

@KenEucker KenEucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaimallea looks good to me!

I was able to successfully run all of the tests on my machine.

@kaimallea kaimallea merged commit 01f5882 into master Mar 4, 2021
@kaimallea
Copy link
Owner Author

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants