Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't block deprecation warnings from the test runner, we should just…

… flag them in tests
  • Loading branch information...
commit c547135df914f2149c05199c8f4073f52fbf0ada 1 parent 04c84ce
@wagenet wagenet authored
View
66 packages/ember-metal/tests/accessors/getPath_test.js
@@ -5,8 +5,7 @@
// ==========================================================================
/*globals Foo:true $foo:true */
-var obj;
-module('Ember.getPath', {
+var obj, moduleOpts = {
setup: function() {
obj = {
foo: {
@@ -35,7 +34,9 @@ module('Ember.getPath', {
Foo = null;
$foo = null;
}
-});
+};
+
+module('Ember.getPath', moduleOpts);
// ..........................................................
// LOCAL PATHS
@@ -112,9 +113,44 @@ test('[obj, this.Foo.bar] -> (null)', function() {
});
// ..........................................................
+// NO TARGET
+//
+
+test('[null, Foo] -> Foo', function() {
+ deepEqual(Ember.getPath('Foo'), Foo);
+});
+
+test('[null, Foo.bar] -> Foo.bar', function() {
+ deepEqual(Ember.getPath('Foo.bar'), Foo.bar);
+});
+
+test('[null, Foo*bar] -> Foo.bar', function() {
+ deepEqual(Ember.getPath('Foo*bar'), Foo.bar);
+});
+
+test('[null, Foo.bar*baz.biff] -> Foo.bar.baz.biff', function() {
+ deepEqual(Ember.getPath('Foo.bar*baz.biff'), Foo.bar.baz.biff);
+});
+
+test('[null, Foo.bar.baz*biff] -> Foo.bar.baz.biff', function() {
+ deepEqual(Ember.getPath('Foo.bar.baz*biff'), Foo.bar.baz.biff);
+});
+
+// ..........................................................
// GLOBAL PATHS (DEPRECATED)
//
+module('Ember.getPath - deprecated', {
+ setup: function() {
+ Ember.TESTING_DEPRECATION = true;
+ moduleOpts.setup();
+ },
+ teardown: function() {
+ Ember.TESTING_DEPRECATION = false;
+ moduleOpts.teardown();
+ }
+});
+
test('[obj, Foo] -> undefined', function() {
deepEqual(Ember.getPath(obj, 'Foo'), Foo);
});
@@ -138,27 +174,3 @@ test('[obj, Foo.bar.baz*biff] -> Foo.bar.baz.biff', function() {
test('[obj, $foo.bar.baz] -> $foo.bar.baz', function() {
deepEqual(Ember.getPath(obj, '$foo.bar.baz'), $foo.bar.baz);
});
-
-// ..........................................................
-// NO TARGET
-//
-
-test('[null, Foo] -> Foo', function() {
- deepEqual(Ember.getPath('Foo'), Foo);
-});
-
-test('[null, Foo.bar] -> Foo.bar', function() {
- deepEqual(Ember.getPath('Foo.bar'), Foo.bar);
-});
-
-test('[null, Foo*bar] -> Foo.bar', function() {
- deepEqual(Ember.getPath('Foo*bar'), Foo.bar);
-});
-
-test('[null, Foo.bar*baz.biff] -> Foo.bar.baz.biff', function() {
- deepEqual(Ember.getPath('Foo.bar*baz.biff'), Foo.bar.baz.biff);
-});
-
-test('[null, Foo.bar.baz*biff] -> Foo.bar.baz.biff', function() {
- deepEqual(Ember.getPath('Foo.bar.baz*biff'), Foo.bar.baz.biff);
-});
View
70 packages/ember-metal/tests/accessors/setPath_test.js
@@ -5,8 +5,7 @@
// ==========================================================================
/*globals Foo:true $foo:true */
-var obj;
-module('Ember.setPath', {
+var obj, moduleOpts = {
setup: function() {
obj = {
foo: {
@@ -35,7 +34,9 @@ module('Ember.setPath', {
Foo = null;
$foo = null;
}
-});
+};
+
+module('Ember.setPath', moduleOpts);
// ..........................................................
// LOCAL PATHS
@@ -115,10 +116,47 @@ test('[obj, this.foo.bar*baz.biff] -> obj.foo.bar.baz.biff', function() {
equal(Ember.getPath(obj, 'foo.bar.baz.biff'), "BAM");
});
+
+// ..........................................................
+// NO TARGET
+//
+
+test('[null, Foo.bar] -> Foo.bar', function() {
+ Ember.setPath(null, 'Foo.bar', "BAM");
+ equal(Ember.getPath(Foo, 'bar'), "BAM");
+});
+
+test('[null, Foo*bar] -> Foo.bar', function() {
+ Ember.setPath(null, 'Foo*bar', "BAM");
+ equal(Ember.getPath(Foo, 'bar'), "BAM");
+});
+
+test('[null, Foo.bar*baz.biff] -> Foo.bar.baz.biff', function() {
+ Ember.setPath(null, 'Foo.bar*baz.biff', "BAM");
+ equal(Ember.getPath(Foo, 'bar.baz.biff'), "BAM");
+});
+
+test('[null, Foo.bar.baz*biff] -> Foo.bar.baz.biff', function() {
+ Ember.setPath(null, 'Foo.bar.baz*biff', "BAM");
+ equal(Ember.getPath(Foo, 'bar.baz.biff'), "BAM");
+});
+
+
// ..........................................................
// GLOBAL PATHS (DEPRECATED)
//
+module("Ember.setPath - deprecated", {
+ setup: function() {
+ Ember.TESTING_DEPRECATION = true;
+ moduleOpts.setup();
+ },
+ teardown: function() {
+ Ember.TESTING_DEPRECATION = false;
+ moduleOpts.teardown();
+ }
+});
+
test('[obj, Foo] -> EXCEPTION', function() {
raises(function() {
Ember.setPath(obj, 'Foo', "BAM");
@@ -160,29 +198,3 @@ test('[obj, $foo.bar.baz] -> $foo.bar.baz', function() {
Ember.setPath(obj, '$foo.bar.baz', "BAM");
equal(Ember.getPath($foo, 'bar.baz'), "BAM");
});
-
-
-
-// ..........................................................
-// NO TARGET
-//
-
-test('[null, Foo.bar] -> Foo.bar', function() {
- Ember.setPath(null, 'Foo.bar', "BAM");
- equal(Ember.getPath(Foo, 'bar'), "BAM");
-});
-
-test('[null, Foo*bar] -> Foo.bar', function() {
- Ember.setPath(null, 'Foo*bar', "BAM");
- equal(Ember.getPath(Foo, 'bar'), "BAM");
-});
-
-test('[null, Foo.bar*baz.biff] -> Foo.bar.baz.biff', function() {
- Ember.setPath(null, 'Foo.bar*baz.biff', "BAM");
- equal(Ember.getPath(Foo, 'bar.baz.biff'), "BAM");
-});
-
-test('[null, Foo.bar.baz*biff] -> Foo.bar.baz.biff', function() {
- Ember.setPath(null, 'Foo.bar.baz*biff', "BAM");
- equal(Ember.getPath(Foo, 'bar.baz.biff'), "BAM");
-});
View
9 packages/ember-runtime/tests/legacy_1x/system/set_test.js
@@ -20,6 +20,8 @@ var a, b, c ; // global variables
module("creating Ember.Set instances", {
setup: function() {
+ Ember.TESTING_DEPRECATION = true;
+
// create objects...
a = { name: "a" } ;
b = { name: "b" } ;
@@ -27,6 +29,8 @@ module("creating Ember.Set instances", {
},
teardown: function() {
+ Ember.TESTING_DEPRECATION = false;
+
a = undefined ;
b = undefined ;
c = undefined ;
@@ -173,6 +177,8 @@ module("Ember.Set.remove + Ember.Set.contains", {
// generate a set with every type of object, but none of the specific
// ones we add in the tests below...
setup: function() {
+ Ember.TESTING_DEPRECATION = true;
+
set = Ember.Set.create(Ember.A([
Ember.Object.create({ dummy: true }),
{ isHash: true },
@@ -181,6 +187,7 @@ module("Ember.Set.remove + Ember.Set.contains", {
},
teardown: function() {
+ Ember.TESTING_DEPRECATION = false;
set = undefined ;
}
@@ -282,6 +289,7 @@ module("Ember.Set.pop + Ember.Set.copy", {
// generate a set with every type of object, but none of the specific
// ones we add in the tests below...
setup: function() {
+ Ember.TESTING_DEPRECATION = true;
set = Ember.Set.create(Ember.A([
Ember.Object.create({ dummy: true }),
{ isHash: true },
@@ -290,6 +298,7 @@ module("Ember.Set.pop + Ember.Set.copy", {
},
teardown: function() {
+ Ember.TESTING_DEPRECATION = false;
set = undefined ;
}
});
View
9 packages/ember-runtime/tests/system/namespace/base_test.js
@@ -8,7 +8,14 @@ module('Ember.Namespace', {
teardown: function() {
if (window.NamespaceA) { window.NamespaceA.destroy(); }
if (window.NamespaceB) { window.NamespaceB.destroy(); }
- if (window.namespaceC) { window.namespaceC.destroy(); }
+ if (window.namespaceC) {
+ try {
+ Ember.TESTING_DEPRECATION = true;
+ window.namespaceC.destroy();
+ } finally {
+ Ember.TESTING_DEPRECATION = false;
+ }
+ }
}
});
View
3  tests/qunit/run-qunit.js
@@ -8,9 +8,8 @@ if (args.length < 1 || args.length > 2) {
var page = require('webpage').create();
-var depRe = /^DEPRECATION:/;
page.onConsoleMessage = function(msg) {
- if (!depRe.test(msg)) console.log(msg);
+ console.log(msg);
};
page.open(args[0], function(status) {
Please sign in to comment.
Something went wrong with that request. Please try again.