@@ -20,7 +20,7 @@ describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
20
20
const { result } = await harness . executeOnce ( ) ;
21
21
22
22
expect ( result ?. success ) . toBe ( true ) ;
23
- harness . expectFile ( 'dist/index.html' ) . content . toContain ( 'integrity=' ) ;
23
+ harness . expectFile ( 'dist/index.html' ) . content . not . toContain ( 'integrity=' ) ;
24
24
} ) ;
25
25
26
26
it ( `does not add integrity attribute when 'false'` , async ( ) => {
@@ -32,7 +32,7 @@ describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
32
32
const { result } = await harness . executeOnce ( ) ;
33
33
34
34
expect ( result ?. success ) . toBe ( true ) ;
35
- harness . expectFile ( 'dist/index.html' ) . content . toContain ( 'integrity=' ) ;
35
+ harness . expectFile ( 'dist/index.html' ) . content . not . toContain ( 'integrity=' ) ;
36
36
} ) ;
37
37
38
38
it ( `does add integrity attribute when 'true'` , async ( ) => {
@@ -46,5 +46,25 @@ describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
46
46
expect ( result ?. success ) . toBe ( true ) ;
47
47
harness . expectFile ( 'dist/index.html' ) . content . toMatch ( / i n t e g r i t y = " \w + - [ A - Z a - z 0 - 9 \/ \+ = ] + " / ) ;
48
48
} ) ;
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
+ } ) ;
49
69
} ) ;
50
70
} ) ;
0 commit comments