This repository was archived by the owner on Mar 13, 2018. It is now read-only.
File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ module.exports = function(karma) {
13
13
'ShadowDOM/node_modules/chai/chai.js' ,
14
14
'ShadowDOM/shadowdom.js' ,
15
15
'ShadowDOM/test/test.main.js' ,
16
+ { pattern : 'ShadowDOM/build.json' , included : false } ,
16
17
{ pattern : 'ShadowDOM/src/**/*.js' , included : false } ,
17
18
{ pattern : 'ShadowDOM/test/**/*.js' , included : false } ,
18
19
{ pattern : 'ShadowDOM/test/**/*.html' , included : false } ,
Original file line number Diff line number Diff line change @@ -12,18 +12,20 @@ suite('build.json', function() {
12
12
13
13
test ( 'Ensure lists match' , function ( done ) {
14
14
var xhrJson = new XMLHttpRequest ;
15
- xhrJson . open ( 'GET' , '../build.json' ) ;
15
+ // karma serves the test runner at /context.html, need to adjust xhr request url to match
16
+ var requestBase = window . __karma__ ? '/base/ShadowDOM/' : '../' ;
17
+ xhrJson . open ( 'GET' , requestBase + 'build.json' ) ;
16
18
xhrJson . onload = function ( ) {
17
19
var buildJson = JSON . parse ( xhrJson . responseText ) ;
18
20
19
21
var xhrJs = new XMLHttpRequest ;
20
- xhrJs . open ( 'GET' , '../ shadowdom.js') ;
22
+ xhrJs . open ( 'GET' , requestBase + ' shadowdom.js') ;
21
23
xhrJs . onload = function ( ) {
22
24
var sources = [ ] ;
23
25
24
26
document . write = function ( s ) {
25
27
var path =
26
- s . slice ( '<script src="../' . length , - '"><\/script>' . length ) ;
28
+ s . slice ( ( '<script src="' + requestBase ) . length , - '"><\/script>' . length ) ;
27
29
sources . push ( path ) ;
28
30
} ;
29
31
You can’t perform that action at this time.
0 commit comments