diff --git a/packages/angular/build/src/builders/application/tests/behavior/csp-nonce_spec.ts b/packages/angular/build/src/builders/application/tests/behavior/csp-nonce_spec.ts new file mode 100644 index 000000000000..eaeff9d1249c --- /dev/null +++ b/packages/angular/build/src/builders/application/tests/behavior/csp-nonce_spec.ts @@ -0,0 +1,35 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import { buildApplication } from '../../index'; +import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; + +describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { + describe('Behavior: "CSP Nonce"', () => { + it('should add CSP nonce to scripts when optimization is disabled', async () => { + await harness.modifyFile('src/index.html', (content) => + content.replace(/', + ); + indexFileContent.toContain('