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 @@ -144,16 +144,26 @@ describe('$log', function() {
144
144
describe ( '$log.error' , function ( ) {
145
145
var e , $log , errorArgs ;
146
146
147
+ function TestError ( ) {
148
+ Error . prototype . constructor . apply ( this , arguments ) ;
149
+ this . message = undefined ;
150
+ this . sourceURL = undefined ;
151
+ this . line = undefined ;
152
+ this . stack = undefined ;
153
+ }
154
+ TestError . prototype = Object . create ( Error . prototype ) ;
155
+ TestError . prototype . constructor = TestError ;
156
+
147
157
beforeEach ( function ( ) {
148
- e = new Error ( '' ) ;
149
- e . message = undefined ;
150
- e . sourceURL = undefined ;
151
- e . line = undefined ;
152
- e . stack = undefined ;
153
-
154
- $log = new $LogProvider ( ) . $get [ 1 ] ( { console : { error : function ( ) {
155
- errorArgs = [ ] . slice . call ( arguments , 0 ) ;
156
- } } } ) ;
158
+ e = new TestError ( '' ) ;
159
+ var mockWindow = {
160
+ console : {
161
+ error : function ( ) {
162
+ errorArgs = [ ] . slice . call ( arguments , 0 ) ;
163
+ }
164
+ }
165
+ } ;
166
+ $log = new $LogProvider ( ) . $get [ 1 ] ( mockWindow ) ;
157
167
} ) ;
158
168
159
169
You can’t perform that action at this time.
0 commit comments