@@ -6,32 +6,32 @@ describe('Custom Loader', function () {
6
6
7
7
describe ( 'scripts' , function ( ) {
8
8
if ( typeof __karma__ == 'undefined' || __karma__ . config . system . ie8 )
9
- it ( 'should support ES6 scripts' , function ( done ) {
10
- customLoader [ 'import' ] ( 'test/loader/test.js' )
11
- . then ( function ( m ) {
12
- expect ( m . loader ) . to . be . equal ( 'custom' ) ;
13
- } )
14
- . then ( done , done )
9
+ it ( 'should support ES6 scripts' , function ( done ) {
10
+ customLoader [ 'import' ] ( 'test/loader/test.js' )
11
+ . then ( function ( m ) {
12
+ expect ( m . loader ) . to . be . equal ( 'custom' ) ;
13
+ } )
14
+ . then ( done , done )
15
15
} ) ;
16
16
17
- it ( 'should support AMD scripts' , function ( done ) {
17
+ it ( 'should support AMD scripts' , function ( done ) {
18
18
customLoader [ 'import' ] ( 'test/loader/amd.js' )
19
- . then ( function ( m ) {
20
- expect ( m . format ) . to . be . equal ( 'amd' ) ;
21
- } )
22
- . then ( done , done ) ;
19
+ . then ( function ( m ) {
20
+ expect ( m . format ) . to . be . equal ( 'amd' ) ;
21
+ } )
22
+ . then ( done , done ) ;
23
23
} ) ;
24
24
} ) ;
25
25
26
26
describe ( 'special #locate path rule' , function a ( ) {
27
27
28
28
if ( typeof __karma__ == 'undefined' || ! __karma__ . config . system . ie8 )
29
- it ( 'should support special loading rules' , function ( done ) {
29
+ it ( 'should support special loading rules' , function ( done ) {
30
30
customLoader [ 'import' ] ( 'path/custom.js' )
31
- . then ( function ( m ) {
32
- expect ( m . path ) . to . be . ok ( ) ;
33
- } )
34
- . then ( done , done ) ;
31
+ . then ( function ( m ) {
32
+ expect ( m . path ) . to . be . ok ( ) ;
33
+ } )
34
+ . then ( done , done ) ;
35
35
} ) ;
36
36
37
37
} ) ;
@@ -43,60 +43,60 @@ describe('Custom Loader', function () {
43
43
}
44
44
var base = baseURL + 'test/loader/' ;
45
45
46
- it ( 'should make the normalize throw' , function ( done ) {
46
+ it ( 'should make the normalize throw' , function ( done ) {
47
47
customLoader [ 'import' ] ( 'test/loader/error1-parent.js' )
48
- . then ( supposeToFail , function ( e ) {
49
- expect ( e . toString ( ) ) . to . contain ( 'Error loading ' + base + 'error1-parent.js' ) ;
50
- } )
51
- . then ( done , done ) ;
48
+ . then ( supposeToFail , function ( e ) {
49
+ expect ( e . toString ( ) ) . to . contain ( 'Error loading ' + base + 'error1-parent.js' ) ;
50
+ } )
51
+ . then ( done , done ) ;
52
52
} ) ;
53
53
54
- it ( 'should make the locate throw' , function ( done ) {
54
+ it ( 'should make the locate throw' , function ( done ) {
55
55
customLoader [ 'import' ] ( 'test/loader/error2' )
56
- . then ( supposeToFail , function ( e ) {
57
- expect ( e . toString ( ) ) . to . be . contain ( 'Error loading ' + base + 'error2' ) ;
58
- } )
59
- . then ( done , done ) ;
56
+ . then ( supposeToFail , function ( e ) {
57
+ expect ( typeof window != 'undefined' ? e . toString ( ) : e . stack ) . to . be . contain ( 'Error loading ' + base + 'error2' ) ;
58
+ } )
59
+ . then ( done , done ) ;
60
60
} ) ;
61
61
62
- it ( 'should make the fetch throw' , function ( done ) {
62
+ it ( 'should make the fetch throw' , function ( done ) {
63
63
customLoader [ 'import' ] ( 'test/loader/error3' )
64
- . then ( supposeToFail , function ( e ) {
65
- expect ( e . toString ( ) ) . to . be . contain ( 'Error loading ' + base + 'error3' ) ;
66
- } )
67
- . then ( done , done ) ;
64
+ . then ( supposeToFail , function ( e ) {
65
+ expect ( typeof window != 'undefined' ? e . toString ( ) : e . stack ) . to . be . contain ( 'Error loading ' + base + 'error3' ) ;
66
+ } )
67
+ . then ( done , done ) ;
68
68
} ) ;
69
69
70
- it ( 'should make the translate throw' , function ( done ) {
70
+ it ( 'should make the translate throw' , function ( done ) {
71
71
customLoader [ 'import' ] ( 'test/loader/error4' )
72
- . then ( supposeToFail , function ( e ) {
73
- expect ( e . toString ( ) ) . to . be . contain ( 'Error loading ' + base + 'error4' ) ;
74
- } )
75
- . then ( done , done ) ;
72
+ . then ( supposeToFail , function ( e ) {
73
+ expect ( typeof window != 'undefined' ? e . toString ( ) : e . stack ) . to . be . contain ( 'Error loading ' + base + 'error4' ) ;
74
+ } )
75
+ . then ( done , done ) ;
76
76
} ) ;
77
77
78
- it ( 'should make the instantiate throw' , function ( done ) {
78
+ it ( 'should make the instantiate throw' , function ( done ) {
79
79
customLoader [ 'import' ] ( 'test/loader/error5' )
80
- . then ( supposeToFail , function ( e ) {
81
- expect ( e . toString ( ) ) . to . be . contain ( 'Error loading ' + base + 'error5' ) ;
82
- } )
83
- . then ( done , done ) ;
80
+ . then ( supposeToFail , function ( e ) {
81
+ expect ( typeof window != 'undefined' ? e . toString ( ) : e . stack ) . to . be . contain ( 'Error loading ' + base + 'error5' ) ;
82
+ } )
83
+ . then ( done , done ) ;
84
84
} ) ;
85
85
86
86
} ) ;
87
87
88
88
} ) ;
89
89
90
90
describe ( '#normalize' , function ( ) {
91
- it ( 'should support async normalization' , function ( done ) {
91
+ it ( 'should support async normalization' , function ( done ) {
92
92
customLoader . normalize ( 'asdfasdf' )
93
- . then ( function ( normalized ) {
94
- return customLoader [ 'import' ] ( normalized ) ;
95
- } )
96
- . then ( function ( m ) {
97
- expect ( m . n ) . to . be . equal ( 'n' ) ;
98
- } )
99
- . then ( done , done ) ;
93
+ . then ( function ( normalized ) {
94
+ return customLoader [ 'import' ] ( normalized ) ;
95
+ } )
96
+ . then ( function ( m ) {
97
+ expect ( m . n ) . to . be . equal ( 'n' ) ;
98
+ } )
99
+ . then ( done , done ) ;
100
100
} ) ;
101
101
} ) ;
102
102
} ) ;
0 commit comments