@@ -188,4 +188,36 @@ describe('moveProjectConfiguration', () => {
188188 expect ( actualProject . implicitDependencies ) . toEqual ( [ 'my-other-lib' ] ) ;
189189 expect ( readJson ( tree , 'nx.json' ) . projects [ 'my-source' ] ) . not . toBeDefined ( ) ;
190190 } ) ;
191+
192+ it ( 'should support moving a standalone project' , ( ) => {
193+ const projectName = 'standalone' ;
194+ const newProjectName = 'parent-standalone' ;
195+ addProjectConfiguration (
196+ tree ,
197+ projectName ,
198+ {
199+ projectType : 'library' ,
200+ root : 'libs/standalone' ,
201+ targets : { } ,
202+ } ,
203+ true
204+ ) ;
205+ const moveSchema : NormalizedSchema = {
206+ projectName : 'standalone' ,
207+ destination : 'parent/standalone' ,
208+ importPath : '@proj/parent-standalone' ,
209+ newProjectName,
210+ relativeToRootDestination : 'libs/parent/standalone' ,
211+ updateImportPath : true ,
212+ } ;
213+
214+ moveProjectConfiguration ( tree , moveSchema , projectConfig ) ;
215+
216+ expect ( ( ) => {
217+ readProjectConfiguration ( tree , projectName ) ;
218+ } ) . toThrow ( ) ;
219+ const ws = readJson ( tree , 'workspace.json' ) ;
220+ expect ( typeof ws . projects [ newProjectName ] ) . toBe ( 'string' ) ;
221+ expect ( readProjectConfiguration ( tree , newProjectName ) ) . toBeDefined ( ) ;
222+ } ) ;
191223} ) ;
0 commit comments