Skip to content

Commit 712d101

Browse files
committed
Issue angular#2343 Fix
Added tests definitions for ngMock debugEnabled and debug methods
1 parent c9c3f71 commit 712d101

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/ngMock/angular-mocksSpec.js

+15
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,14 @@ describe('ngMock', function() {
182182
it('should provide error method', function() {
183183
expect(function() { $log.error(''); }).not.toThrow();
184184
});
185+
186+
it('should provide debug method', function() {
187+
expect(function() { $log.error(''); }).not.toThrow();
188+
});
189+
190+
it('should provide debugEnabled method', function() {
191+
expect(function() { $log.debugEnabled(true); }).not.toThrow();
192+
});
185193

186194
it('should store log messages', function() {
187195
$log.log('fake log');
@@ -202,13 +210,19 @@ describe('ngMock', function() {
202210
$log.error('fake log');
203211
expect($log.error.logs).toContain(['fake log']);
204212
});
213+
214+
it('should store error messages', function() {
215+
$log.error('fake log');
216+
expect($log.debug.logs).toContain(['fake log']);
217+
});
205218

206219
it('should assertEmpty', function(){
207220
try {
208221
$log.error(Error('MyError'));
209222
$log.warn(Error('MyWarn'));
210223
$log.info(Error('MyInfo'));
211224
$log.log(Error('MyLog'));
225+
$log.debug(Error('MyDebug'));
212226
$log.assertEmpty();
213227
} catch (error) {
214228
error = error.message || error;
@@ -226,6 +240,7 @@ describe('ngMock', function() {
226240
$log.warn(Error('MyWarn'));
227241
$log.info(Error('MyInfo'));
228242
$log.log(Error('MyLog'));
243+
$log.debug(Error('MyDebug'));
229244
$log.reset();
230245
var passed = false;
231246
try {

0 commit comments

Comments
 (0)