@@ -20,7 +20,7 @@ describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
2020 const { result } = await harness . executeOnce ( ) ;
2121
2222 expect ( result ?. success ) . toBe ( true ) ;
23- harness . expectFile ( 'dist/index.html' ) . content . toContain ( 'integrity=' ) ;
23+ harness . expectFile ( 'dist/index.html' ) . content . not . toContain ( 'integrity=' ) ;
2424 } ) ;
2525
2626 it ( `does not add integrity attribute when 'false'` , async ( ) => {
@@ -32,7 +32,7 @@ describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
3232 const { result } = await harness . executeOnce ( ) ;
3333
3434 expect ( result ?. success ) . toBe ( true ) ;
35- harness . expectFile ( 'dist/index.html' ) . content . toContain ( 'integrity=' ) ;
35+ harness . expectFile ( 'dist/index.html' ) . content . not . toContain ( 'integrity=' ) ;
3636 } ) ;
3737
3838 it ( `does add integrity attribute when 'true'` , async ( ) => {
@@ -46,5 +46,25 @@ describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
4646 expect ( result ?. success ) . toBe ( true ) ;
4747 harness . expectFile ( 'dist/index.html' ) . content . toMatch ( / i n t e g r i t y = " \w + - [ A - Z a - z 0 - 9 \/ \+ = ] + " / ) ;
4848 } ) ;
49+
50+ it ( `does not issue a warning when 'true' and 'scripts' is set.` , async ( ) => {
51+ await harness . writeFile ( 'src/script.js' , '' ) ;
52+
53+ harness . useTarget ( 'build' , {
54+ ...BASE_OPTIONS ,
55+ subresourceIntegrity : true ,
56+ scripts : [ 'src/script.js' ] ,
57+ } ) ;
58+
59+ const { result, logs } = await harness . executeOnce ( ) ;
60+
61+ expect ( result ?. success ) . toBe ( true ) ;
62+ harness . expectFile ( 'dist/index.html' ) . content . toMatch ( / i n t e g r i t y = " \w + - [ A - Z a - z 0 - 9 \/ \+ = ] + " / ) ;
63+ expect ( logs ) . not . toContain (
64+ jasmine . objectContaining < logging . LogEntry > ( {
65+ message : jasmine . stringMatching ( / s u b r e s o u r c e - i n t e g r i t y / ) ,
66+ } ) ,
67+ ) ;
68+ } ) ;
4969 } ) ;
5070} ) ;
0 commit comments