Skip to content

Conversation

@dougmoscrop
Copy link
Contributor

What did you implement:

Closes #2115

The promise rejections were causing fake 'unhandled rejection' messages to print during the tests. As the related issue says, there's nothing wrong, but this fixes it so that the messages do not get displayed.

How did you implement it:

Using sinon-bluebird.

How can we verify it:

npm test - only affects unit tests.

Todos:

  • Write tests
  • Write documentation
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config/commands/resources
  • Enable "Allow edits from maintainers" for this PR
  • Change ready for review message below

Is this ready for review?: YES
Is it a breaking change?: NO

Copy link
Contributor

@pmuens pmuens left a comment

Choose a reason for hiding this comment

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

Great addition @dougmoscrop 👍

Makes the whole test code a lot easier to read.

Just saw one require (added a comment about it) which might be removed if not needed. Otherwise it's GTM from my side!

Edit: Just tested it w/o this require, which works. Pushed an update to this branch which removes it.

const Package = require('../index');
const Serverless = require('../../../../lib/Serverless');

require('sinon-bluebird');
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is sinon-bluebird required here?

@dougmoscrop
Copy link
Contributor Author

Thanks, yeah that was my bad.

@pmuens
Copy link
Contributor

pmuens commented Dec 22, 2016

No worries! Thanks for the PR @dougmoscrop 💯

@dougmoscrop
Copy link
Contributor Author

Fixed conflicts

@dougmoscrop
Copy link
Contributor Author

Fixed conflicts / rebased - cc @pmuens again :D

@pmuens
Copy link
Contributor

pmuens commented Feb 9, 2017

Thanks @dougmoscrop 👍 /cc @eahefnawy

Edit: We might want to do a follow-up PR because other tests have been written which might still use the old approach...

Copy link
Contributor

@pmuens pmuens left a comment

Choose a reason for hiding this comment

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

Just pushed a quick update so that all the recently added tests also use sinon-bluebird. Will merge after the tests pass.

Thanks for the addition @dougmoscrop 👍 💯

@pmuens pmuens added this to the 1.10 milestone Mar 23, 2017
@pmuens pmuens merged commit 247132c into serverless:master Mar 23, 2017
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

Successfully merging this pull request may close these issues.

Some tests return a reject but won't break the overall tests

2 participants