Suppress warnings and expected errors in test suite

This commit is contained in:
Tim van der Lippe 2015-11-18 16:06:10 +01:00
parent 7e7600a300
commit 92d6fcb8fc
10 changed files with 30 additions and 13 deletions

View File

@ -139,7 +139,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
behaviors: [
Polymer.BehaviorA,
null,
Polymer.BehaviorB
],
@ -260,4 +259,4 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
</script>
</script>

View File

@ -127,6 +127,27 @@ suite('multi-behaviors element', function() {
assert.equal(el.attributes.user.value, 'user', 'Behavior hostAttribute overrode user attribute');
});
test('behaviour is null generates warning', function() {
var warned = false, oldWarn = Polymer.Base._warn;
Polymer.Base._warn = function (message) {
assert.match(message, /behavior is null/);
warned = true;
};
Polymer({
behaviors: [
null
],
is: 'behavior-null'
});
assert.equal(warned, true, 'Null behaviour should generate warning');
Polymer.Base._warn = oldWarn;
});
});

View File

@ -650,7 +650,6 @@ suite('warnings', function() {
var warned = false;
el._warn = function() {
warned = true;
warn.apply(el, arguments);
};
el.noObserver = 42;
assert.equal(warned, true, 'no warning for undefined observer');
@ -660,7 +659,6 @@ suite('warnings', function() {
var warned = false;
el._warn = function() {
warned = true;
warn.apply(el, arguments);
};
el.noComplexObserver = {};
assert.equal(warned, true, 'no warning for undefined complex observer');
@ -670,7 +668,6 @@ suite('warnings', function() {
var warned = false;
el._warn = function() {
warned = true;
warn.apply(el, arguments);
};
el.noComputed = 99;
assert.equal(warned, true, 'no warning for undefined computed function');
@ -680,7 +677,6 @@ suite('warnings', function() {
var warned = false;
el._warn = function() {
warned = true;
warn.apply(el, arguments);
};
el.noInlineComputed = 99;
assert.equal(warned, true, 'no warning for undefined computed function');

View File

@ -116,7 +116,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assert.equal(tree.rules.length, 4, 'unexpected number of rules');
assert.equal(tree.rules[2].rules.length, 8, 'unexpected number of rules in keyframes');
assert.equal(tree.rules[3].rules.length, 1, 'unexpected number of rules in @media');
console.log('test');
});
test('rule selectors parse', function() {

View File

@ -1,5 +1,4 @@
<script>
console.log('x-needs-repeat loaded')
Polymer({
is: 'x-needs-host',
ready: function() {
@ -9,4 +8,4 @@ console.log('x-needs-repeat loaded')
this.config = this.dataHost.getAttribute('config');
}
});
</script>
</script>

View File

@ -226,6 +226,5 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</script>
<link rel="import" href="dom-bind-elements2.html">
<link rel="import" href="should-404.html">
</body>
</html>

View File

@ -103,9 +103,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
suite('errors', function() {
test('items must be array', function() {
assert.throws(function() {
inDocumentRepeater.items = {};
}, /expected array/, 'should warn when items is not array');
var warned = false;
inDocumentRepeater._error = function(message) {
assert.match(message, /expected array/)
warned = true;
}
inDocumentRepeater.items = {};
assert.equal(warned, true, 'should warn when items is not array');
});
});

0
test/unit/sub/foo.png Normal file
View File

0
test/unit/sub/foo.z Normal file
View File

0
test/unit/sub/google.png Normal file
View File