File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -14,17 +14,24 @@ describe('config.js', () => {
1414 window . location = originalLocation ;
1515 } ) ;
1616
17- it ( 'should return empty prefix for localhost' , async ( ) => {
17+ it ( 'should return /js for localhost' , async ( ) => {
1818 // @ts -ignore
1919 window . location = { hostname : 'localhost' } ;
2020 const config = ( await import ( '../js/config.js' ) ) . default ;
2121 expect ( config . BASE_URL ) . toBe ( '/js' ) ;
2222 } ) ;
2323
24- it ( 'should return /vanillajs-patterns prefix for non-localhost ' , async ( ) => {
24+ it ( 'should return /vanillajs-patterns/js for GitHub Pages host ' , async ( ) => {
2525 // @ts -ignore
26- window . location = { hostname : 'example.com ' } ;
26+ window . location = { hostname : 'quantuminformation.github.io ' } ;
2727 const config = ( await import ( '../js/config.js' ) ) . default ;
2828 expect ( config . BASE_URL ) . toBe ( '/vanillajs-patterns/js' ) ;
2929 } ) ;
30+
31+ it ( 'should return /js for other non-localhost domains' , async ( ) => {
32+ // @ts -ignore
33+ window . location = { hostname : 'example.com' } ;
34+ const config = ( await import ( '../js/config.js' ) ) . default ;
35+ expect ( config . BASE_URL ) . toBe ( '/js' ) ;
36+ } ) ;
3037} ) ;
You can’t perform that action at this time.
0 commit comments