@@ -11,7 +11,7 @@ describe('Content security policies', function () {
1111 let defaultConfig , csp
1212
1313 before ( function ( ) {
14- csp = require ( '../lib /csp' )
14+ csp = require ( '../dist /csp' )
1515 } )
1616
1717 beforeEach ( function ( ) {
@@ -32,21 +32,21 @@ describe('Content security policies', function () {
3232 } )
3333
3434 afterEach ( function ( ) {
35- mock . stop ( '../lib /config' )
36- csp = mock . reRequire ( '../lib /csp' )
35+ mock . stop ( '../dist /config' )
36+ csp = mock . reRequire ( '../dist /csp' )
3737 } )
3838
3939 after ( function ( ) {
4040 mock . stopAll ( )
41- csp = mock . reRequire ( '../lib /csp' )
41+ csp = mock . reRequire ( '../dist /csp' )
4242 } )
4343
4444 // beginnging Tests
4545 it ( 'Disable CDN' , function ( ) {
4646 const testconfig = defaultConfig
4747 testconfig . useCDN = false
48- mock ( '../lib /config' , testconfig )
49- csp = mock . reRequire ( '../lib /csp' )
48+ mock ( '../dist /config' , testconfig )
49+ csp = mock . reRequire ( '../dist /csp' )
5050
5151 assert ( ! csp . computeDirectives ( ) . scriptSrc . includes ( 'https://cdnjs.cloudflare.com' ) )
5252 assert ( ! csp . computeDirectives ( ) . scriptSrc . includes ( 'https://cdn.jsdelivr.net' ) )
@@ -61,17 +61,17 @@ describe('Content security policies', function () {
6161 it ( 'Disable Google Analytics' , function ( ) {
6262 const testconfig = defaultConfig
6363 testconfig . csp . addGoogleAnalytics = false
64- mock ( '../lib /config' , testconfig )
65- csp = mock . reRequire ( '../lib /csp' )
64+ mock ( '../dist /config' , testconfig )
65+ csp = mock . reRequire ( '../dist /csp' )
6666
6767 assert ( ! csp . computeDirectives ( ) . scriptSrc . includes ( 'https://www.google-analytics.com' ) )
6868 } )
6969
7070 it ( 'Disable Disqus' , function ( ) {
7171 const testconfig = defaultConfig
7272 testconfig . csp . addDisqus = false
73- mock ( '../lib /config' , testconfig )
74- csp = mock . reRequire ( '../lib /csp' )
73+ mock ( '../dist /config' , testconfig )
74+ csp = mock . reRequire ( '../dist /csp' )
7575
7676 assert ( ! csp . computeDirectives ( ) . scriptSrc . includes ( 'https://disqus.com' ) )
7777 assert ( ! csp . computeDirectives ( ) . scriptSrc . includes ( 'https://*.disqus.com' ) )
@@ -83,16 +83,16 @@ describe('Content security policies', function () {
8383 it ( 'Set ReportURI' , function ( ) {
8484 const testconfig = defaultConfig
8585 testconfig . csp . reportURI = 'https://example.com/reportURI'
86- mock ( '../lib /config' , testconfig )
87- csp = mock . reRequire ( '../lib /csp' )
86+ mock ( '../dist /config' , testconfig )
87+ csp = mock . reRequire ( '../dist /csp' )
8888
8989 assert . strictEqual ( csp . computeDirectives ( ) . reportUri , 'https://example.com/reportURI' )
9090 } )
9191
9292 it ( 'Set own directives' , function ( ) {
9393 const testconfig = defaultConfig
94- mock ( '../lib /config' , defaultConfig )
95- csp = mock . reRequire ( '../lib /csp' )
94+ mock ( '../dist /config' , defaultConfig )
95+ csp = mock . reRequire ( '../dist /csp' )
9696 const unextendedCSP = csp . computeDirectives ( )
9797 testconfig . csp . directives = {
9898 defaultSrc : [ 'https://default.example.com' ] ,
@@ -105,8 +105,8 @@ describe('Content security policies', function () {
105105 childSrc : [ 'https://child.example.com' ] ,
106106 connectSrc : [ 'https://connect.example.com' ]
107107 }
108- mock ( '../lib /config' , testconfig )
109- csp = mock . reRequire ( '../lib /csp' )
108+ mock ( '../dist /config' , testconfig )
109+ csp = mock . reRequire ( '../dist /csp' )
110110
111111 const variations = [ 'default' , 'script' , 'img' , 'style' , 'font' , 'object' , 'media' , 'child' , 'connect' ]
112112
0 commit comments