From d9418e1adb2a29d124ff762cf442f7b71bd7af1a Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Tue, 7 Mar 2017 13:50:15 -0800 Subject: [PATCH] another test fix. --- lib/legacy/class.html | 2 +- test/unit/mixin-behaviors.html | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/legacy/class.html b/lib/legacy/class.html index b828ecb047..7411d4bb15 100644 --- a/lib/legacy/class.html +++ b/lib/legacy/class.html @@ -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`. diff --git a/test/unit/mixin-behaviors.html b/test/unit/mixin-behaviors.html index 139b83b870..3a598b6318 100644 --- a/test/unit/mixin-behaviors.html +++ b/test/unit/mixin-behaviors.html @@ -495,11 +495,7 @@ }); 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: [ @@ -507,8 +503,8 @@ ] }); 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() {