This repository has been archived by the owner on Nov 11, 2017. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 32
Properly expectDeprecation
when test
parameter is a function
#153
Merged
mixonic
merged 1 commit into
emberjs:master
from
bantic:expect-deprecate-with-function-test
Jun 12, 2015
Merged
Properly expectDeprecation
when test
parameter is a function
#153
mixonic
merged 1 commit into
emberjs:master
from
bantic:expect-deprecate-with-function-test
Jun 12, 2015
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
waiting on a test |
`Ember.deprecate` is called with `(message, test, options)`. When `test` is falsy or a function that evaluates to falsy, the deprecation is issued. `expectDeprecation` was correctly evaluating the `test` param when it is a function, but not pushing the correct result of that function into `actuals`. This made using `expectDeprecate` fail for a deprecation that used a test function. Example: ``` // Ember code function foo() { Ember.deprecate('message', function() { return false; }); } // test code -- this test would erroneously fail because // expectDeprecation pushes ['message', function() { return false; }] // onto actuals instead of ['message', false] expectDeprecation(function() { foo(); }, 'message'); ```
bantic
force-pushed
the
expect-deprecate-with-function-test
branch
from
June 12, 2015 17:02
4007c81
to
9b2cf9b
Compare
@mixonic updated. fixed the test that was erroneously passing before. |
mixonic
added a commit
that referenced
this pull request
Jun 12, 2015
Properly `expectDeprecation` when `test` parameter is a function
bantic
added a commit
to bantic/ember.js
that referenced
this pull request
Jun 12, 2015
…lect"}} Use a template-compiler plugin to detect `{{view "string"}}` at compile-time and issue a deprecation with location information. Has a special case deprecation when the string === "select". Removes a test from the view helper tests that was checking for the deprecation at runtime (and removes the associated code in the ember-htmlbars package's `keywords/view`). Note: This does not catch a deprecation when the path is not a string, e.g., `{{view view.someProperty}}`, however emberjs#11401 would catch and issue a deprecation message for that case (at runtime). Also a few changes to deprecations: * document `id` param to `Ember.deprecate` * include deprecation id in log/error message * Use dot-namespaced deprecation ids (more similar to how `instrument` works and paves the way to in the future changing deprecation log levels by paths ie `"view.*"`) * globally silence view-related deprecations in tests to avoid overflowing travis ci's log * update ember-dev dep in bower (pr: emberjs/ember-dev#153) to `a064f0cd2f4c225ffd023b63d4cb31a79db04aaf` * change the view-and-controller-path template compiler plugin to always deprecate `{{controller}}` * change the view-and-controller-path template compiler plugin to skip deprecating `{{view}}` when `Ember.ENV._ENABLE_LEGACY_VIW_SUPPORT` is true refs emberjs#11377
rwjblue
pushed a commit
to emberjs/ember.js
that referenced
this pull request
Jun 13, 2015
…lect"}} Use a template-compiler plugin to detect `{{view "string"}}` at compile-time and issue a deprecation with location information. Has a special case deprecation when the string === "select". Removes a test from the view helper tests that was checking for the deprecation at runtime (and removes the associated code in the ember-htmlbars package's `keywords/view`). Note: This does not catch a deprecation when the path is not a string, e.g., `{{view view.someProperty}}`, however #11401 would catch and issue a deprecation message for that case (at runtime). Also a few changes to deprecations: * document `id` param to `Ember.deprecate` * include deprecation id in log/error message * Use dot-namespaced deprecation ids (more similar to how `instrument` works and paves the way to in the future changing deprecation log levels by paths ie `"view.*"`) * globally silence view-related deprecations in tests to avoid overflowing travis ci's log * update ember-dev dep in bower (pr: emberjs/ember-dev#153) to `a064f0cd2f4c225ffd023b63d4cb31a79db04aaf` * change the view-and-controller-path template compiler plugin to always deprecate `{{controller}}` * change the view-and-controller-path template compiler plugin to skip deprecating `{{view}}` when `Ember.ENV._ENABLE_LEGACY_VIW_SUPPORT` is true refs #11377 (cherry picked from commit c2bcc86)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ember.deprecate
is called with(message, test, options)
. Whentest
is falsy or a function that evaluates to falsy, the deprecationis issued.
expectDeprecation
was correctly evaluating thetest
param when it isa function, but not pushing the correct result of that function into
actuals
. This made usingexpectDeprecate
fail for a deprecation that useda test function.
Example: