@@ -59,8 +59,8 @@ module('workflow config', function (hooks) {
5959 test ( 'deprecation logs with id matcher' , ( assert ) => {
6060 assert . expect ( 1 ) ;
6161
62- let message = 'log-id ' ;
63- let id = 'ember.workflow ' ;
62+ let message = 'arbitrary-unmatched-message ' ;
63+ let id = 'log-me ' ;
6464 let options = {
6565 id,
6666 since : '2.0.0' ,
@@ -79,10 +79,11 @@ module('workflow config', function (hooks) {
7979 } ) ;
8080
8181 test ( 'deprecation limits each id to 100 console.logs' , ( assert ) => {
82+ assert . expect ( 104 ) ;
8283 let limit = 100 ;
8384
84- let message = 'log-id ' ;
85- let id = 'ember.workflow ' ;
85+ let message = 'log-me ' ;
86+ let id = 'first-and-unique-to-limit-test ' ;
8687 let options = {
8788 id,
8889 since : '2.0.0' ,
@@ -100,13 +101,14 @@ module('workflow config', function (hooks) {
100101 expected ,
101102 'deprecation logs'
102103 ) ;
103- } else if ( count === limit + 1 ) {
104- assert . equal (
105- passedMessage ,
106- 'To avoid console overflow, this deprecation will not be logged any more in this run.'
107- ) ;
108- } else {
109- assert . ok ( false , 'No further logging expected' ) ;
104+ }
105+ if ( count === limit ) {
106+ window . Testem . handleConsoleMessage = function ( passedMessage ) {
107+ assert . equal (
108+ passedMessage ,
109+ 'To avoid console overflow, this deprecation will not be logged any more in this run.'
110+ ) ;
111+ } ;
110112 }
111113 } ;
112114
@@ -115,10 +117,10 @@ module('workflow config', function (hooks) {
115117 deprecate ( message , false , options ) ;
116118 }
117119
118- assert . equal ( count , limit + 1 , 'logged 101 times, including final notice' ) ;
120+ assert . equal ( count , limit , 'logged 100 times, including final notice' ) ;
119121
120- let secondMessage = 'log-id2 ' ;
121- let secondId = 'ember.workflow2 ' ;
122+ let secondMessage = 'log-me ' ;
123+ let secondId = 'second-and-unique-to-limit-test ' ;
122124 let secondOptions = {
123125 id : secondId ,
124126 since : '2.0.0' ,
@@ -135,6 +137,9 @@ module('workflow config', function (hooks) {
135137 secondExpected ,
136138 'second deprecation logs'
137139 ) ;
140+ window . Testem . handleConsoleMessage = function ( ) {
141+ assert . ok ( false , 'No further logging expected' ) ;
142+ } ;
138143 } ;
139144
140145 deprecate ( secondMessage , false , secondOptions ) ;
0 commit comments