Skip to content

Commit 76929e6

Browse files
committed
fixup! fix(@schematics/angular): migrate ng-packagr glob string assets in use-library-builder
1 parent a99f33b commit 76929e6

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎packages/schematics/angular/migrations/use-library-builder/migration_spec.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,24 @@ describe('Migration to use the library builder', () => {
349349
]);
350350
});
351351

352+
it('should keep ng-packagr assets outside the project root as paths', async () => {
353+
tree.overwrite(
354+
'/projects/my-lib/ng-package.json',
355+
JSON.stringify({
356+
assets: ['../../../shared-assets'],
357+
lib: { entryFile: 'src/public-api.ts' },
358+
}),
359+
);
360+
361+
const newTree = await schematicRunner.runSchematic(schematicName, {}, tree);
362+
const {
363+
projects: { 'my-lib': lib },
364+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
365+
} = newTree.readJson('/angular.json') as any;
366+
367+
expect(lib.architect['build'].options.assets).toEqual(['../shared-assets']);
368+
});
369+
352370
it('should preserve existing stylePreprocessorOptions.includePaths when migrating styleIncludePaths', async () => {
353371
const angularJson = JSON.parse(tree.readContent('/angular.json'));
354372
angularJson.projects['my-lib'].architect.build.options.stylePreprocessorOptions = {

0 commit comments

Comments
 (0)