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

[BUGFIX] Fixes #4397 add silentError with deprecation #4398

Merged
merged 2 commits into from Jul 8, 2015

Conversation

trabus
Copy link
Contributor

@trabus trabus commented Jul 8, 2015

Fixes #4397

I can try and write a quick test for this as well if desired.

var silentError = require('silent-error');
var deprecate = require('../utilities/deprecate');

module.exports = function(){
Copy link
Contributor

Choose a reason for hiding this comment

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

this would need to be

Object.defineProperty(module, 'exports', {
  get: function () { return SilentError; }
});

or the consumer must do:

require('silent-error')(); // <-- notice the extra ();

Copy link
Contributor

Choose a reason for hiding this comment

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

although a pain, we should add a test to confirm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay.


describe('SilentError', function() {
it('return silent-error and print a deprecation', function() {
expect(SilentErrorLib, 'returns silent-error').to.equal(SilentError);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stefanpenner This prints a deprecation when testing, but I'm completely forgetting how I can capture that in a unit test to validate.

rwjblue added a commit that referenced this pull request Jul 8, 2015
[BUGFIX] Fixes #4397 add silentError with deprecation
@rwjblue rwjblue merged commit bb0cff7 into ember-cli:master Jul 8, 2015
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.

None yet

4 participants