@@ -16,20 +16,26 @@ module('workflow config', function (hooks) {
16
16
window . Testem . handleConsoleMessage = originalWarn ;
17
17
} ) ;
18
18
19
+ < << << << HEAD
19
20
test ( 'deprecation silenced with string matcher' , ( assert ) => {
20
21
deprecate ( 'silence-me' , false , {
21
22
since : '2.0.0' ,
23
+ === === =
24
+ test ( 'deprecation silenced with message matcher' , ( assert ) = > {
25
+ deprecate ( 'silence-strict' , false , {
26
+ since : 'now' ,
27
+ >>> >>> > c9e2029 ( Many fixes , limit system and tests )
22
28
until : 'forever' ,
23
29
id : 'test' ,
24
30
for : 'testing' ,
25
31
} ) ;
26
32
assert . ok ( true , 'Deprecation did not raise' ) ;
27
33
} ) ;
28
34
29
- test ( 'deprecation logs with string matcher' , ( assert ) => {
35
+ test ( 'deprecation logs with message matcher' , ( assert ) = > {
30
36
assert . expect ( 1 ) ;
31
37
32
- let message = 'log-me ' ;
38
+ let message = 'log-strict ' ;
33
39
window . Testem . handleConsoleMessage = function ( passedMessage ) {
34
40
assert . ok (
35
41
passedMessage . indexOf ( 'DEPRECATION: ' + message ) === 0 ,
@@ -44,11 +50,51 @@ module('workflow config', function (hooks) {
44
50
} ) ;
45
51
} ) ;
46
52
53
+ test ( 'deprecation logs with message matcher by regex' , ( assert ) => {
54
+ assert . expect ( 1 ) ;
55
+
56
+ let message = ' foo log-match foo' ;
57
+ window . Testem . handleConsoleMessage = function ( passedMessage ) {
58
+ assert . ok (
59
+ passedMessage . indexOf ( 'DEPRECATION: ' + message ) === 0 ,
60
+ 'deprecation logs'
61
+ ) ;
62
+ } ;
63
+ deprecate ( message , false , {
64
+ since : 'now' ,
65
+ until : 'forever' ,
66
+ id : 'test' ,
67
+ for : 'testing' ,
68
+ } ) ;
69
+ } ) ;
70
+
71
+ test ( 'deprecation logs with id matcher' , ( assert ) => {
72
+ assert . expect ( 1 ) ;
73
+
74
+ let message = ' foo foo' ;
75
+ window . Testem . handleConsoleMessage = function ( passedMessage ) {
76
+ assert . ok (
77
+ passedMessage . indexOf ( 'DEPRECATION: ' + message ) === 0 ,
78
+ 'deprecation logs'
79
+ ) ;
80
+ } ;
81
+ deprecate ( message , false , {
82
+ since : 'now' ,
83
+ until : 'forever' ,
84
+ id : 'log-strict' ,
85
+ for : 'testing' ,
86
+ } ) ;
87
+ } ) ;
88
+
47
89
test ( 'deprecation thrown with string matcher' , ( assert ) => {
48
- Ember . ENV . RAISE_ON_DEPRECATION = true ;
49
90
assert . throws ( function ( ) {
91
+ < << << << HEAD
50
92
deprecate ( 'throw-me' , false , {
51
93
since : '2.0.0' ,
94
+ === === =
95
+ deprecate ( 'throw-strict' , false, {
96
+ since : 'now' ,
97
+ >>> >>> > c9e2029 ( Many fixes , limit system and tests )
52
98
until : 'forever' ,
53
99
id : 'test' ,
54
100
for : 'testing' ,
@@ -59,6 +105,7 @@ module('workflow config', function (hooks) {
59
105
test ( 'deprecation logs with id matcher' , ( assert ) => {
60
106
assert . expect ( 1 ) ;
61
107
108
+ < << << << HEAD
62
109
let message = 'arbitrary-unmatched-message' ;
63
110
let id = 'log-me' ;
64
111
let options = {
@@ -67,6 +114,11 @@ module('workflow config', function (hooks) {
67
114
until : '3.0.0' ,
68
115
for : 'testing' ,
69
116
} ;
117
+ = === ===
118
+ let message = 'id matched (log-match)' ;
119
+ let id = 'id-matched' ;
120
+ let options = { id, since : '2.0.0' , until : '3.0.0' , for : 'testing' } ;
121
+ > >>> >>> c9e2029 ( Many fixes , limit system and tests )
70
122
let expected = `DEPRECATION: ${ message } ` ;
71
123
window . Testem . handleConsoleMessage = function ( passedMessage ) {
72
124
assert . equal (
@@ -79,6 +131,7 @@ module('workflow config', function (hooks) {
79
131
} ) ;
80
132
81
133
test ( 'deprecation limits each id to 100 console.logs' , ( assert ) => {
134
+ < << << << HEAD
82
135
assert . expect ( 104 ) ;
83
136
let limit = 100 ;
84
137
@@ -90,6 +143,13 @@ module('workflow config', function (hooks) {
90
143
until : '3.0.0' ,
91
144
for : 'testing' ,
92
145
} ;
146
+ = === ===
147
+ let limit = 100 ;
148
+
149
+ let message = 'first (log-match)' ;
150
+ let id = 'first-and-unique-to-100-limit-test' ;
151
+ let options = { id, since : '2.0.0' , until : '3.0.0' , for : 'testing' } ;
152
+ > >>> >>> c9e2029 ( Many fixes , limit system and tests )
93
153
let expected = `DEPRECATION: ${ message } ` ;
94
154
95
155
let count = 0 ;
@@ -119,8 +179,13 @@ module('workflow config', function (hooks) {
119
179
120
180
assert . equal ( count , limit , 'logged 100 times, including final notice' ) ;
121
181
182
+ < << << << HEAD
122
183
let secondMessage = 'log-me' ;
123
184
let secondId = 'second-and-unique-to-limit-test' ;
185
+ = === ===
186
+ let secondMessage = 'second (log-match)' ;
187
+ let secondId = 'second-and-unique-to-100-limit-test' ;
188
+ > >>> >>> c9e2029 ( Many fixes , limit system and tests )
124
189
let secondOptions = {
125
190
id : secondId ,
126
191
since : '2.0.0' ,
0 commit comments