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

Optionally suppress warnings and deprecations when expected. #5

Open
workmanw opened this issue Mar 2, 2017 · 1 comment
Open

Optionally suppress warnings and deprecations when expected. #5

workmanw opened this issue Mar 2, 2017 · 1 comment
Assignees

Comments

@workmanw
Copy link
Owner

workmanw commented Mar 2, 2017

I think we may need to optionally (possibly by default) suppress warnings and deprecations when they are expected. This means not invoking the next callback in this addons registered handlers (e.g. asserts/deprecation.js#L14).

I had not done so originally because it felt wrong for this addon to swallow warnings and deprecations without knowing what else could be out there wanting to consume them. But practically speaking, not doing so creates a lot a noise in a test that passes. Example:

ok 166 PhantomJS 2.1 - model-fragments shim module: test the shim modules
    ---
        Log: |
            { type: 'warn',
              text: '\'DEPRECATION: Importing from the `model-fragments` module is deprecated. Instead import from `ember-data-model-fragments`. [deprecation id: model-fragments-module-import]\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    raiseOnDeprecation@http://localhost:7357/assets/vendor.js:16116:17\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    http://localhost:7357/assets/test-support.js:4793:11\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    invoke@http://localhost:7357/assets/vendor.js:16213:21\\n    deprecate@http://localhost:7357/assets/vendor.js:16181:37\\n    deprecate@http://localhost:7357/assets/vendor.js:27940:42\\n    http://localhost:7357/assets/vendor.js:71104:22\\n    exports@http://localhost:7357/assets/vendor.js:140:37\\n    requireModule@http://localhost:7357/assets/vendor.js:32:25\\n    http://localhost:7357/assets/tests.js:3799:25\\n    runTest@http://localhost:7357/assets/test-support.js:1060:34\\n    run@http://localhost:7357/assets/test-support.js:1046:13\\n    http://localhost:7357/assets/test-support.js:1220:15\\n    process@http://localhost:7357/assets/test-support.js:2277:26\\n    begin@http://localhost:7357/assets/test-support.js:2260:11\\n    http://localhost:7357/assets/test-support.js:1634:11\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Importing from the `model-fragments` module is deprecated. Instead import from `ember-data-model-fragments`. [deprecation id: model-fragments-module-import]\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    raiseOnDeprecation@http://localhost:7357/assets/vendor.js:16116:17\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    http://localhost:7357/assets/test-support.js:4793:11\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    invoke@http://localhost:7357/assets/vendor.js:16213:21\\n    deprecate@http://localhost:7357/assets/vendor.js:16181:37\\n    deprecate@http://localhost:7357/assets/vendor.js:27940:42\\n    http://localhost:7357/assets/vendor.js:71104:22\\n    exports@http://localhost:7357/assets/vendor.js:140:37\\n    requireModule@http://localhost:7357/assets/vendor.js:32:25\\n    http://localhost:7357/assets/tests.js:3800:25\\n    runTest@http://localhost:7357/assets/test-support.js:1060:34\\n    run@http://localhost:7357/assets/test-support.js:1046:13\\n    http://localhost:7357/assets/test-support.js:1220:15\\n    process@http://localhost:7357/assets/test-support.js:2277:26\\n    begin@http://localhost:7357/assets/test-support.js:2260:11\\n    http://localhost:7357/assets/test-support.js:1634:11\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Importing from the `model-fragments` module is deprecated. Instead import from `ember-data-model-fragments`. [deprecation id: model-fragments-module-import]\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    raiseOnDeprecation@http://localhost:7357/assets/vendor.js:16116:17\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    http://localhost:7357/assets/test-support.js:4793:11\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    invoke@http://localhost:7357/assets/vendor.js:16213:21\\n    deprecate@http://localhost:7357/assets/vendor.js:16181:37\\n    deprecate@http://localhost:7357/assets/vendor.js:27940:42\\n    http://localhost:7357/assets/vendor.js:71104:22\\n    exports@http://localhost:7357/assets/vendor.js:140:37\\n    requireModule@http://localhost:7357/assets/vendor.js:32:25\\n    http://localhost:7357/assets/tests.js:3801:25\\n    runTest@http://localhost:7357/assets/test-support.js:1060:34\\n    run@http://localhost:7357/assets/test-support.js:1046:13\\n    http://localhost:7357/assets/test-support.js:1220:15\\n    process@http://localhost:7357/assets/test-support.js:2277:26\\n    begin@http://localhost:7357/assets/test-support.js:2260:11\\n    http://localhost:7357/assets/test-support.js:1634:11\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Importing from the `model-fragments` module is deprecated. Instead import from `ember-data-model-fragments`. [deprecation id: model-fragments-module-import]\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    raiseOnDeprecation@http://localhost:7357/assets/vendor.js:16116:17\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    http://localhost:7357/assets/test-support.js:4793:11\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    invoke@http://localhost:7357/assets/vendor.js:16213:21\\n    deprecate@http://localhost:7357/assets/vendor.js:16181:37\\n    deprecate@http://localhost:7357/assets/vendor.js:27940:42\\n    http://localhost:7357/assets/vendor.js:71104:22\\n    exports@http://localhost:7357/assets/vendor.js:140:37\\n    requireModule@http://localhost:7357/assets/vendor.js:32:25\\n    http://localhost:7357/assets/tests.js:3802:25\\n    runTest@http://localhost:7357/assets/test-support.js:1060:34\\n    run@http://localhost:7357/assets/test-support.js:1046:13\\n    http://localhost:7357/assets/test-support.js:1220:15\\n    process@http://localhost:7357/assets/test-support.js:2277:26\\n    begin@http://localhost:7357/assets/test-support.js:2260:11\\n    http://localhost:7357/assets/test-support.js:1634:11\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Importing from the `model-fragments` module is deprecated. Instead import from `ember-data-model-fragments`. [deprecation id: model-fragments-module-import]\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    raiseOnDeprecation@http://localhost:7357/assets/vendor.js:16116:17\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    http://localhost:7357/assets/test-support.js:4793:11\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    invoke@http://localhost:7357/assets/vendor.js:16213:21\\n    deprecate@http://localhost:7357/assets/vendor.js:16181:37\\n    deprecate@http://localhost:7357/assets/vendor.js:27940:42\\n    http://localhost:7357/assets/vendor.js:71104:22\\n    exports@http://localhost:7357/assets/vendor.js:140:37\\n    requireModule@http://localhost:7357/assets/vendor.js:32:25\\n    http://localhost:7357/assets/tests.js:3803:25\\n    runTest@http://localhost:7357/assets/test-support.js:1060:34\\n    run@http://localhost:7357/assets/test-support.js:1046:13\\n    http://localhost:7357/assets/test-support.js:1220:15\\n    process@http://localhost:7357/assets/test-support.js:2277:26\\n    begin@http://localhost:7357/assets/test-support.js:2260:11\\n    http://localhost:7357/assets/test-support.js:1634:11\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Importing from the `model-fragments` module is deprecated. Instead import from `ember-data-model-fragments`. [deprecation id: model-fragments-module-import]\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    raiseOnDeprecation@http://localhost:7357/assets/vendor.js:16116:17\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    http://localhost:7357/assets/test-support.js:4793:11\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    invoke@http://localhost:7357/assets/vendor.js:16213:21\\n    deprecate@http://localhost:7357/assets/vendor.js:16181:37\\n    deprecate@http://localhost:7357/assets/vendor.js:27940:42\\n    http://localhost:7357/assets/vendor.js:71104:22\\n    exports@http://localhost:7357/assets/vendor.js:140:37\\n    requireModule@http://localhost:7357/assets/vendor.js:32:25\\n    http://localhost:7357/assets/tests.js:3804:25\\n    runTest@http://localhost:7357/assets/test-support.js:1060:34\\n    run@http://localhost:7357/assets/test-support.js:1046:13\\n    http://localhost:7357/assets/test-support.js:1220:15\\n    process@http://localhost:7357/assets/test-support.js:2277:26\\n    begin@http://localhost:7357/assets/test-support.js:2260:11\\n    http://localhost:7357/assets/test-support.js:1634:11\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Importing from the `model-fragments` module is deprecated. Instead import from `ember-data-model-fragments`. [deprecation id: model-fragments-module-import]\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    raiseOnDeprecation@http://localhost:7357/assets/vendor.js:16116:17\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    http://localhost:7357/assets/test-support.js:4793:11\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    invoke@http://localhost:7357/assets/vendor.js:16213:21\\n    deprecate@http://localhost:7357/assets/vendor.js:16181:37\\n    deprecate@http://localhost:7357/assets/vendor.js:27940:42\\n    http://localhost:7357/assets/vendor.js:71104:22\\n    exports@http://localhost:7357/assets/vendor.js:140:37\\n    requireModule@http://localhost:7357/assets/vendor.js:32:25\\n    http://localhost:7357/assets/tests.js:3805:25\\n    runTest@http://localhost:7357/assets/test-support.js:1060:34\\n    run@http://localhost:7357/assets/test-support.js:1046:13\\n    http://localhost:7357/assets/test-support.js:1220:15\\n    process@http://localhost:7357/assets/test-support.js:2277:26\\n    begin@http://localhost:7357/assets/test-support.js:2260:11\\n    http://localhost:7357/assets/test-support.js:1634:11\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Importing from the `model-fragments` module is deprecated. Instead import from `ember-data-model-fragments`. [deprecation id: model-fragments-module-import]\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    raiseOnDeprecation@http://localhost:7357/assets/vendor.js:16116:17\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    http://localhost:7357/assets/test-support.js:4793:11\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    invoke@http://localhost:7357/assets/vendor.js:16213:21\\n    deprecate@http://localhost:7357/assets/vendor.js:16181:37\\n    deprecate@http://localhost:7357/assets/vendor.js:27940:42\\n    http://localhost:7357/assets/vendor.js:71104:22\\n    exports@http://localhost:7357/assets/vendor.js:140:37\\n    requireModule@http://localhost:7357/assets/vendor.js:32:25\\n    http://localhost:7357/assets/tests.js:3809:25\\n    runTest@http://localhost:7357/assets/test-support.js:1060:34\\n    run@http://localhost:7357/assets/test-support.js:1046:13\\n    http://localhost:7357/assets/test-support.js:1220:15\\n    process@http://localhost:7357/assets/test-support.js:2277:26\\n    begin@http://localhost:7357/assets/test-support.js:2260:11\\n    http://localhost:7357/assets/test-support.js:1634:11\'\n' }
            { type: 'warn',
              text: '\'DEPRECATION: Importing from the `model-fragments` module is deprecated. Instead import from `ember-data-model-fragments`. [deprecation id: model-fragments-module-import]\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    raiseOnDeprecation@http://localhost:7357/assets/vendor.js:16116:17\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    http://localhost:7357/assets/test-support.js:4793:11\\n    http://localhost:7357/assets/vendor.js:16197:15\\n    invoke@http://localhost:7357/assets/vendor.js:16213:21\\n    deprecate@http://localhost:7357/assets/vendor.js:16181:37\\n    deprecate@http://localhost:7357/assets/vendor.js:27940:42\\n    http://localhost:7357/assets/vendor.js:71104:22\\n    exports@http://localhost:7357/assets/vendor.js:140:37\\n    requireModule@http://localhost:7357/assets/vendor.js:32:25\\n    http://localhost:7357/assets/tests.js:3810:25\\n    runTest@http://localhost:7357/assets/test-support.js:1060:34\\n    run@http://localhost:7357/assets/test-support.js:1046:13\\n    http://localhost:7357/assets/test-support.js:1220:15\\n    process@http://localhost:7357/assets/test-support.js:2277:26\\n    begin@http://localhost:7357/assets/test-support.js:2260:11\\n    http://localhost:7357/assets/test-support.js:1634:11\'\n' }
    ...
@rwjblue
Copy link
Collaborator

rwjblue commented Mar 2, 2017

Confirm. We should not emit the deprecations that were expected to the console.

@workmanw workmanw self-assigned this Mar 2, 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

No branches or pull requests

2 participants