@@ -122,17 +122,18 @@ describe 'middleware.karma', ->
122
122
it ' should serve context.html with replaced link tags' , (done ) ->
123
123
includedFiles [
124
124
new MockFile (' /first.css' , ' sha007' )
125
+ new MockFile (' /second.html' , ' sha678' )
125
126
]
126
127
127
128
response .once ' end' , ->
128
129
expect (nextSpy).not .to .have .been .called
129
130
expect (response).to .beServedAs 200 , ' CONTEXT\n ' +
130
- ' <link type="text/css" href="/absolute/first.css?sha007" rel="stylesheet">'
131
+ ' <link type="text/css" href="/absolute/first.css?sha007" rel="stylesheet">\n ' +
132
+ ' <link href="/absolute/second.html?sha678" rel="import">'
131
133
done ()
132
134
133
135
callHandlerWith ' /__karma__/context.html'
134
136
135
-
136
137
it ' should serve context.html with the correct path for the script tags' , (done ) ->
137
138
includedFiles [
138
139
new MockFile (' /some/abc/a.js' , ' sha' )
@@ -153,13 +154,17 @@ describe 'middleware.karma', ->
153
154
includedFiles [
154
155
new MockFile (' /some/abc/a.css' , ' sha1' )
155
156
new MockFile (' /base/path/b.css' , ' sha2' )
157
+ new MockFile (' /some/abc/c.html' , ' sha3' )
158
+ new MockFile (' /base/path/d.html' , ' sha4' )
156
159
]
157
160
158
161
response .once ' end' , ->
159
162
expect (nextSpy).not .to .have .been .called
160
163
expect (response).to .beServedAs 200 , ' CONTEXT\n ' +
161
164
' <link type="text/css" href="/absolute/some/abc/a.css?sha1" rel="stylesheet">\n ' +
162
- ' <link type="text/css" href="/base/b.css?sha2" rel="stylesheet">'
165
+ ' <link type="text/css" href="/base/b.css?sha2" rel="stylesheet">\n ' +
166
+ ' <link href="/absolute/some/abc/c.html?sha3" rel="import">\n ' +
167
+ ' <link href="/base/d.html?sha4" rel="import">'
163
168
done ()
164
169
165
170
callHandlerWith ' /__karma__/context.html'
@@ -231,13 +236,17 @@ describe 'middleware.karma', ->
231
236
includedFiles [
232
237
new MockFile (' /first.css' )
233
238
new MockFile (' /base/path/b.css' )
239
+ new MockFile (' /second.html' )
240
+ new MockFile (' /base/path/d.html' )
234
241
]
235
242
236
243
response .once ' end' , ->
237
244
expect (nextSpy).not .to .have .been .called
238
245
expect (response).to .beServedAs 200 , ' DEBUG\n ' +
239
246
' <link type="text/css" href="/absolute/first.css" rel="stylesheet">\n ' +
240
- ' <link type="text/css" href="/base/b.css" rel="stylesheet">'
247
+ ' <link type="text/css" href="/base/b.css" rel="stylesheet">\n ' +
248
+ ' <link href="/absolute/second.html" rel="import">\n ' +
249
+ ' <link href="/base/d.html" rel="import">'
241
250
done ()
242
251
243
252
callHandlerWith ' /__karma__/debug.html'
0 commit comments