Skip to content

Commit 92d6fcb

Browse files
committed
Suppress warnings and expected errors in test suite
1 parent 7e7600a commit 92d6fcb

10 files changed

Lines changed: 30 additions & 13 deletions

File tree

‎test/unit/behaviors-elements.html‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@
139139

140140
behaviors: [
141141
Polymer.BehaviorA,
142-
null,
143142
Polymer.BehaviorB
144143
],
145144

@@ -260,4 +259,4 @@
260259

261260
});
262261

263-
</script>
262+
</script>

‎test/unit/behaviors.html‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,27 @@
127127
assert.equal(el.attributes.user.value, 'user', 'Behavior hostAttribute overrode user attribute');
128128
});
129129

130+
test('behaviour is null generates warning', function() {
131+
var warned = false, oldWarn = Polymer.Base._warn;
132+
Polymer.Base._warn = function (message) {
133+
assert.match(message, /behavior is null/);
134+
warned = true;
135+
};
136+
137+
Polymer({
138+
139+
behaviors: [
140+
null
141+
],
142+
143+
is: 'behavior-null'
144+
145+
});
146+
147+
assert.equal(warned, true, 'Null behaviour should generate warning');
148+
Polymer.Base._warn = oldWarn;
149+
});
150+
130151
});
131152

132153

‎test/unit/bind.html‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,6 @@
650650
var warned = false;
651651
el._warn = function() {
652652
warned = true;
653-
warn.apply(el, arguments);
654653
};
655654
el.noObserver = 42;
656655
assert.equal(warned, true, 'no warning for undefined observer');
@@ -660,7 +659,6 @@
660659
var warned = false;
661660
el._warn = function() {
662661
warned = true;
663-
warn.apply(el, arguments);
664662
};
665663
el.noComplexObserver = {};
666664
assert.equal(warned, true, 'no warning for undefined complex observer');
@@ -670,7 +668,6 @@
670668
var warned = false;
671669
el._warn = function() {
672670
warned = true;
673-
warn.apply(el, arguments);
674671
};
675672
el.noComputed = 99;
676673
assert.equal(warned, true, 'no warning for undefined computed function');
@@ -680,7 +677,6 @@
680677
var warned = false;
681678
el._warn = function() {
682679
warned = true;
683-
warn.apply(el, arguments);
684680
};
685681
el.noInlineComputed = 99;
686682
assert.equal(warned, true, 'no warning for undefined computed function');

‎test/unit/css-parse.html‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@
116116
assert.equal(tree.rules.length, 4, 'unexpected number of rules');
117117
assert.equal(tree.rules[2].rules.length, 8, 'unexpected number of rules in keyframes');
118118
assert.equal(tree.rules[3].rules.length, 1, 'unexpected number of rules in @media');
119-
console.log('test');
120119
});
121120

122121
test('rule selectors parse', function() {

‎test/unit/dom-bind-elements2.html‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script>
2-
console.log('x-needs-repeat loaded')
32
Polymer({
43
is: 'x-needs-host',
54
ready: function() {
@@ -9,4 +8,4 @@
98
this.config = this.dataHost.getAttribute('config');
109
}
1110
});
12-
</script>
11+
</script>

‎test/unit/dom-bind.html‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,5 @@
226226
</script>
227227

228228
<link rel="import" href="dom-bind-elements2.html">
229-
<link rel="import" href="should-404.html">
230229
</body>
231230
</html>

‎test/unit/dom-repeat.html‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,13 @@ <h4>x-repeat-chunked</h4>
103103
suite('errors', function() {
104104

105105
test('items must be array', function() {
106-
assert.throws(function() {
107-
inDocumentRepeater.items = {};
108-
}, /expected array/, 'should warn when items is not array');
106+
var warned = false;
107+
inDocumentRepeater._error = function(message) {
108+
assert.match(message, /expected array/)
109+
warned = true;
110+
}
111+
inDocumentRepeater.items = {};
112+
assert.equal(warned, true, 'should warn when items is not array');
109113
});
110114

111115
});

‎test/unit/sub/foo.png‎

Loading

‎test/unit/sub/foo.z‎

Whitespace-only changes.

‎test/unit/sub/google.png‎

Loading

0 commit comments

Comments
 (0)