Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Fix broken uploadLastResult test
Browse files Browse the repository at this point in the history
I forgot to provide a default value for the options, plus the promises
used in the test case were never returned, leading to silent failures.
  • Loading branch information
trotzig committed Dec 7, 2016
1 parent 73e607b commit 6814100
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/server/__tests__/uploadLastResult-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('when there are files to upload', () => {
],
}));

uploadLastResult().then(() => {
return uploadLastResult().then(() => {
// 2 times each diff, 1 times the new image, 1 times index.html
expect(uploadMock.mock.calls.length).toEqual(6);
});
Expand All @@ -70,7 +70,7 @@ describe('when there are files to upload', () => {
],
}));

uploadLastResult().then(() => {
return uploadLastResult().then(() => {
// 1 times the new image, 1 times index.html
expect(uploadMock.mock.calls.length).toEqual(2);
});
Expand Down
2 changes: 1 addition & 1 deletion src/server/uploadLastResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function uploadHTMLFile({ uploader, diffImages, newImages, triggeredByUrl }) {
* @return {Promise} that resolves with a URL to the html document uploaded to
* s3.
*/
module.exports = function uploadLastResult(triggeredByUrl, { debug }) {
module.exports = function uploadLastResult(triggeredByUrl, { debug } = {}) {
return new Promise((resolve, reject) => {
const { diffImages, newImages } = getLastResultSummary();

Expand Down

0 comments on commit 6814100

Please sign in to comment.