Skip to content

Commit

Permalink
fix behavior warn test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Mar 7, 2017
1 parent 7cebe12 commit 4439436
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions test/unit/behaviors.html
Original file line number Diff line number Diff line change
Expand Up @@ -414,20 +414,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 4439436

Please sign in to comment.