File tree 1 file changed +19
-9
lines changed
1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -138,16 +138,26 @@ describe('$log', function() {
138
138
describe ( '$log.error' , function ( ) {
139
139
var e , $log , errorArgs ;
140
140
141
+ function TestError ( ) {
142
+ Error . prototype . constructor . apply ( this , arguments ) ;
143
+ this . message = undefined ;
144
+ this . sourceURL = undefined ;
145
+ this . line = undefined ;
146
+ this . stack = undefined ;
147
+ }
148
+ TestError . prototype = Object . create ( Error . prototype ) ;
149
+ TestError . prototype . constructor = TestError ;
150
+
141
151
beforeEach ( function ( ) {
142
- e = new Error ( '' ) ;
143
- e . message = undefined ;
144
- e . sourceURL = undefined ;
145
- e . line = undefined ;
146
- e . stack = undefined ;
147
-
148
- $log = new $LogProvider ( ) . $get [ 1 ] ( { console : { error : function ( ) {
149
- errorArgs = [ ] . slice . call ( arguments , 0 ) ;
150
- } } } ) ;
152
+ e = new TestError ( '' ) ;
153
+ var mockWindow = {
154
+ console : {
155
+ error : function ( ) {
156
+ errorArgs = [ ] . slice . call ( arguments , 0 ) ;
157
+ }
158
+ }
159
+ } ;
160
+ $log = new $LogProvider ( ) . $get [ 1 ] ( mockWindow ) ;
151
161
} ) ;
152
162
153
163
You can’t perform that action at this time.
0 commit comments