-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@angular-devkit/build-angular):
extractLicenses
didn't have an …
…effect when using server builder
- Loading branch information
1 parent
54c170b
commit 9a04975
Showing
4 changed files
with
62 additions
and
16 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
packages/angular_devkit/build_angular/src/server/tests/options/extract-licenses_spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* @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.io/license | ||
*/ | ||
|
||
import { execute } from '../../index'; | ||
import { BASE_OPTIONS, SERVER_BUILDER_INFO, describeBuilder } from '../setup'; | ||
|
||
describeBuilder(execute, SERVER_BUILDER_INFO, (harness) => { | ||
describe('Option: "extractLicenses"', () => { | ||
it(`should generate '3rdpartylicenses.txt' when 'extractLicenses' is true`, async () => { | ||
harness.useTarget('server', { | ||
...BASE_OPTIONS, | ||
extractLicenses: true, | ||
}); | ||
|
||
const { result } = await harness.executeOnce(); | ||
expect(result?.success).toBe(true); | ||
harness.expectFile('dist/3rdpartylicenses.txt').content.toContain('MIT'); | ||
}); | ||
|
||
it(`should not generate '3rdpartylicenses.txt' when 'extractLicenses' is false`, async () => { | ||
harness.useTarget('server', { | ||
...BASE_OPTIONS, | ||
extractLicenses: false, | ||
}); | ||
|
||
const { result } = await harness.executeOnce(); | ||
expect(result?.success).toBe(true); | ||
harness.expectFile('dist/3rdpartylicenses.txt').toNotExist(); | ||
}); | ||
|
||
it(`should generate '3rdpartylicenses.txt' when 'extractLicenses' is not set`, async () => { | ||
harness.useTarget('server', { | ||
...BASE_OPTIONS, | ||
}); | ||
|
||
const { result } = await harness.executeOnce(); | ||
expect(result?.success).toBe(true); | ||
harness.expectFile('dist/3rdpartylicenses.txt').content.toContain('MIT'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters