Skip to content

Commit

Permalink
Suppress warnings and expected errors in test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
TimvdLippe committed Nov 19, 2015
1 parent 7e7600a commit 92d6fcb
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 13 deletions.
3 changes: 1 addition & 2 deletions test/unit/behaviors-elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@

behaviors: [
Polymer.BehaviorA,
null,
Polymer.BehaviorB
],

Expand Down Expand Up @@ -260,4 +259,4 @@

});

</script>
</script>
21 changes: 21 additions & 0 deletions test/unit/behaviors.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,27 @@
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;
});

});


Expand Down
4 changes: 0 additions & 4 deletions test/unit/bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,6 @@
var warned = false;
el._warn = function() {
warned = true;
warn.apply(el, arguments);
};
el.noObserver = 42;
assert.equal(warned, true, 'no warning for undefined observer');
Expand All @@ -660,7 +659,6 @@
var warned = false;
el._warn = function() {
warned = true;
warn.apply(el, arguments);
};
el.noComplexObserver = {};
assert.equal(warned, true, 'no warning for undefined complex observer');
Expand All @@ -670,7 +668,6 @@
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');
Expand All @@ -680,7 +677,6 @@
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');
Expand Down
1 change: 0 additions & 1 deletion test/unit/css-parse.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
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() {
Expand Down
3 changes: 1 addition & 2 deletions test/unit/dom-bind-elements2.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script>
console.log('x-needs-repeat loaded')
Polymer({
is: 'x-needs-host',
ready: function() {
Expand All @@ -9,4 +8,4 @@
this.config = this.dataHost.getAttribute('config');
}
});
</script>
</script>
1 change: 0 additions & 1 deletion test/unit/dom-bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,5 @@
</script>

<link rel="import" href="dom-bind-elements2.html">
<link rel="import" href="should-404.html">
</body>
</html>
10 changes: 7 additions & 3 deletions test/unit/dom-repeat.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,13 @@ <h4>x-repeat-chunked</h4>
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');
});

});
Expand Down
Empty file added test/unit/sub/foo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added test/unit/sub/foo.z
Empty file.
Empty file added test/unit/sub/google.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 92d6fcb

Please sign in to comment.