diff --git a/packages/workspace/src/generators/move/lib/update-imports.spec.ts b/packages/workspace/src/generators/move/lib/update-imports.spec.ts index cff2940ca9fd9..2f651aa7a6c39 100644 --- a/packages/workspace/src/generators/move/lib/update-imports.spec.ts +++ b/packages/workspace/src/generators/move/lib/update-imports.spec.ts @@ -258,6 +258,38 @@ describe('updateImports', () => { expect(tree.read(importerFilePath, 'utf-8')).toMatchSnapshot(); }); + it('should not throw error on export list', async () => { + await libraryGenerator(tree, { + name: 'my-destination', + config: 'project', + projectNameAndRootFormat: 'as-provided', + }); + await libraryGenerator(tree, { + name: 'my-source', + projectNameAndRootFormat: 'as-provided', + }); + await libraryGenerator(tree, { + name: 'my-importer', + projectNameAndRootFormat: 'as-provided', + }); + const importerFilePath = 'my-importer/src/importer.ts'; + tree.write( + importerFilePath, + ` + import { MyClass } from '@proj/my-source'; + + export { MyClass }; + ` + ); + const projectConfig = readProjectConfiguration(tree, 'my-source'); + + const normalizedSchema = await normalizeSchema(tree, schema, projectConfig); + + expect(() => + updateImports(tree, normalizedSchema, projectConfig) + ).not.toThrow(); + }); + it('should update require imports', async () => { await libraryGenerator(tree, { name: 'table',