Skip to content

Commit

Permalink
another test fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Mar 7, 2017
1 parent 4439436 commit d9418e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/legacy/class.html
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
*/
Polymer.Class = function(info) {
if (!info) {
Polymer._warn('Polymer.Class requires `info` argument');
console.warn('Polymer.Class requires `info` argument');
}
let klass = GenerateClassFromInfo(info, info.behaviors ?
// note: mixinBehaviors ensures `LegacyElementMixin`.
Expand Down
10 changes: 3 additions & 7 deletions test/unit/mixin-behaviors.html
Original file line number Diff line number Diff line change
Expand Up @@ -495,20 +495,16 @@
});

test('behavior is null generates warning', function() {
var warned = false, oldWarn = Polymer._warn;
Polymer._warn = function(message) {
assert.match(message, /behavior is null/);
warned = true;
};
sinon.spy(console, 'warn');
Polymer({
is: 'behavior-null',
behaviors: [
null
]
});
document.createElement('behavior-null');
assert.equal(warned, true, 'Null behaviour should generate warning');
Polymer.Base._warn = oldWarn;
assert.equal(console.warn.callCount, 1, 'Null behaviour should generate warning');
console.warn.restore();
});

test('behavior array is unique', function() {
Expand Down

0 comments on commit d9418e1

Please sign in to comment.